/// <summary> /// Releases the player. /// </summary> private void ReleasePlayer() { if (_player != null) { _debugViewHelper.Stop(); _debugViewHelper = null; _shouldAutoPlay = _player.PlayWhenReady; _shouldRestorePosition = false; Timeline timeline = _player.CurrentTimeline; if (timeline != null) { _playerWindow = _player.CurrentWindowIndex; Timeline.Window window = timeline.GetWindow(_playerWindow, new Timeline.Window()); if (!window.IsDynamic) { _shouldRestorePosition = true; _playerPosition = window.IsSeekable ? _player.CurrentPosition : C.TimeUnset; } } _player.Release(); _player = null; _trackSelector = null; _trackSelectionHelper = null; _eventLogger = null; } }
private void ReleasePlayer() { if (player != null) { debugViewHelper.Stop(); debugViewHelper = null; shouldAutoPlay = player.PlayWhenReady; UpdateResumePosition(); player.Release(); player = null; trackSelector = null; trackSelectionHelper = null; eventLogger = null; } }