dispose method

void dispose()

Dispose the player

Implementation

void dispose() {
  if (!disposed) {
    disposed = true;
    _eventSubscription?.cancel();
    if (id.value != null) {
      _methodChannel.invokeMethod('dispose', id.value);
    }
    id.dispose();
    mediaInfo.dispose();
    videoSize.dispose();
    position.dispose();
    error.dispose();
    loading.dispose();
    playbackState.dispose();
    volume.dispose();
    speed.dispose();
    looping.dispose();
    autoPlay.dispose();
    finishedTimes.dispose();
    bufferRange.dispose();
    overrideTracks.dispose();
    maxBitRate.dispose();
    maxResolution.dispose();
    preferredAudioLanguage.dispose();
    preferredSubtitleLanguage.dispose();
    showSubtitle.dispose();
  }
}