public void Pause() { if (PlaybackSession.PlaybackState == MediaPlaybackState.Playing) { _player?.Pause(); PlaybackSession.PlaybackState = MediaPlaybackState.Paused; } }
public override void ViewDidDisappear(bool animated) { base.ViewDidDisappear(animated); if (player != null) { player.Pause(); playerLooper.Dispose(); player.Dispose(); } }
public override void ViewDidDisappear(bool animated) { base.ViewDidDisappear(animated); // Kill media and tidy up if (_avplayer != null) { _avplayer.Pause(); _avplayer.Dispose(); _avplayer = null; } if (_avplayerController != null) { _avplayerController.RemoveFromParentViewController(); _avplayerController.View.RemoveFromSuperview(); _avplayerController.Dispose(); _avplayerController = null; } }