dispose method

Future<void> dispose()

dispose de video_player controller

Implementation

Future<void> dispose() async {
  _timer?.cancel();
  _timerForVolume?.cancel();
  _timerForGettingVolume?.cancel();
  timerForTrackingMouse?.cancel();
  _timerForSeek?.cancel();
  _timerForCheckingSeek?.cancel();
  videoFitChangedTimer?.cancel();
  _pipModeWorker?.dispose();
  _position.close();
  _playerEventSubs?.cancel();
  _sliderPosition.close();
  _duration.close();
  _buffered.close();
  _closedCaptionEnabled.close();
  _mute.close();
  _fullscreen.close();
  _showControls.close();

  playerStatus.status.close();
  dataStatus.status.close();

  removeListeners();
  await _videoPlayerController?.dispose();
  _videoPlayerController = null;
}