Exemple #1
0
 public void Pause()
 {
     if (PlaybackSession.PlaybackState == MediaPlaybackState.Playing)
     {
         _player?.Pause();
         PlaybackSession.PlaybackState = MediaPlaybackState.Paused;
     }
 }
Exemple #2
0
 public override void ViewDidDisappear(bool animated)
 {
     base.ViewDidDisappear(animated);
     if (player != null)
     {
         player.Pause();
         playerLooper.Dispose();
         player.Dispose();
     }
 }
Exemple #3
0
        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;
            }
        }