コード例 #1
0
ファイル: MainPage.xaml.cs プロジェクト: petrj/DVBTTelevizor
        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();
             }
         });
     });
 }