예제 #1
0
        public async Task ActionStop(bool force)
        {
            _loggingService.Debug($"Calling ActionStop (Force: {force}, PlayingState: {PlayingState})");

            if (_media == null || videoView == null || videoView.MediaPlayer == null)
            {
                return;
            }

            if (!force && (PlayingState == PlayingStateEnum.Playing))
            {
                PlayingState = PlayingStateEnum.PlayingInPreview;
            }
            else
            if (force || (PlayingState == PlayingStateEnum.PlayingInPreview))
            {
                Device.BeginInvokeOnMainThread(async() =>
                {
                    videoView.MediaPlayer.Stop();
                });
                PlayingState = PlayingStateEnum.Stopped;
                _viewModel.PlayingChannel = null;

                if (!_driver.Recording)
                {
                    await _driver.Stop();
                }
            }
        }
예제 #2
0
 public void StopPlay()
 {
     Device.BeginInvokeOnMainThread(() =>
     {
         Playing = false;
         videoView.MediaPlayer.Stop();
         Task.Run(async() =>
         {
             if (!_driver.Recording)
             {
                 await _driver.Stop();
             }
         });
     });
 }