private async void CallDispatcher3() { await Window.Current.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { OutputVideo.SetSource(stream, _OutputFile.ContentType); }); }
void OutputPlayButton_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e) { if (OutputVideo.DefaultPlaybackRate == 0) { OutputVideo.DefaultPlaybackRate = 1.0; OutputVideo.PlaybackRate = 1.0; } OutputVideo.Play(); }
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(); } }); }
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); }
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); } }); }
void OutputPauseButton_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e) { OutputVideo.Pause(); }
void OutputStopButton_Click(Object sender, Windows.UI.Xaml.RoutedEventArgs e) { OutputVideo.Stop(); }
void OutputPauseButton_Click(Object sender, RoutedEventArgs e) { OutputVideo.Pause(); }
void OutputStopButton_Click(Object sender, RoutedEventArgs e) { OutputVideo.Stop(); }