示例#1
0
 private async void CallDispatcher3()
 {
     await Window.Current.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         OutputVideo.SetSource(stream, _OutputFile.ContentType);
     });
 }
示例#2
0
        void OutputPlayButton_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            if (OutputVideo.DefaultPlaybackRate == 0)
            {
                OutputVideo.DefaultPlaybackRate = 1.0;
                OutputVideo.PlaybackRate        = 1.0;
            }

            OutputVideo.Play();
        }
示例#3
0
 async void StopPlayers()
 {
     await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
     {
         if (InputVideo.CurrentState != MediaElementState.Paused)
         {
             InputVideo.Pause();
         }
         if (OutputVideo.CurrentState != MediaElementState.Paused)
         {
             OutputVideo.Pause();
         }
     });
 }
示例#4
0
        async void TranscodeComplete()
        {
            OutputText("Transcode completed.");
            OutputPathText("Output (" + _OutputFile.Path + ")");
            Windows.Storage.Streams.IRandomAccessStream stream = await _OutputFile.OpenAsync(Windows.Storage.FileAccessMode.Read);

            await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                OutputVideo.SetSource(stream, _OutputFile.ContentType);
            });

            EnableButtons();
            SetCancelButton(false);
        }
示例#5
0
 async void PlayFile(Windows.Storage.StorageFile MediaFile)
 {
     await _dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async() =>
     {
         try
         {
             Windows.Storage.Streams.IRandomAccessStream stream = await MediaFile.OpenAsync(FileAccessMode.Read);
             OutputVideo.SetSource(stream, MediaFile.ContentType);
             OutputVideo.Play();
         }
         catch (Exception exception)
         {
             TranscodeError(exception.Message);
         }
     });
 }
示例#6
0
 void OutputPauseButton_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e)
 {
     OutputVideo.Pause();
 }
示例#7
0
 void OutputStopButton_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e)
 {
     OutputVideo.Stop();
 }
示例#8
0
 void OutputPauseButton_Click(Object sender, RoutedEventArgs e)
 {
     OutputVideo.Pause();
 }
示例#9
0
 void OutputStopButton_Click(Object sender, RoutedEventArgs e)
 {
     OutputVideo.Stop();
 }