private void OnSourceRequsted(PlayToManager sender, PlayToSourceRequestedEventArgs args) { var deferral = args.SourceRequest.GetDeferral(); Execute.OnUIThread(async() => { if (CurrentFile != null) { var source = await CreateSourceAsync(); if (source == null) { args.SourceRequest.DisplayErrorString(Strings.PlayToInvalidMediaType); } else { args.SourceRequest.SetSource(source); CurrentConnection = source.Connection; } } else { args.SourceRequest.DisplayErrorString(Strings.PlayToNoFile); } deferral.Complete(); }); }
private void playToManager_SourceRequested(PlayToManager sender, PlayToSourceRequestedEventArgs args) { var deferral = args.SourceRequest.GetDeferral(); var handler = dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { args.SourceRequest.SetSource(ImageSource.PlayToSource); deferral.Complete(); }); }
private async void PlayToManagerOnSourceRequested(PlayToManager sender, PlayToSourceRequestedEventArgs args) { var deferral = args.SourceRequest.GetDeferral(); await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { args.SourceRequest.SetSource(this.mpTrailer.PlayToSource); deferral.Complete(); }); }
private async void OnSourceRequested(PlayToManager sender, PlayToSourceRequestedEventArgs args) { var deferral = args.SourceRequest.GetDeferral(); await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { args.SourceRequest.SetSource(MediaDetails.PlayToSource); deferral.Complete(); }); }
private async void OnPlayToSourceRequested(PlayToManager sender, PlayToSourceRequestedEventArgs e) { await dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { PlayToSourceDeferral deferral = e.SourceRequest.GetDeferral(); PlayToSourceRequest sr = e.SourceRequest; sr.SetSource(videoMediaElement.PlayToSource); deferral.Complete(); }); }
void manager_SourceRequested(PlayToManager sender, PlayToSourceRequestedEventArgs args) { var deferral = args.SourceRequest.GetDeferral(); var handler = dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { if (MusicBox.Visibility == Visibility.Visible) { args.SourceRequest.SetSource(MusicSource.PlayToSource); } else if (VideoBox.Visibility == Visibility.Visible) { args.SourceRequest.SetSource(VideoSource.PlayToSource); } else if (PhotoSource.Visibility == Visibility.Visible) { args.SourceRequest.SetSource(PhotoSource.PlayToSource); } deferral.Complete(); }); }
private void OnPlayToSourceRequested(PlayToManager sender, PlayToSourceRequestedEventArgs args) { //args.SourceRequest.DisplayErrorString("Test error string"); var deferral = args.SourceRequest.GetDeferral(); // This request will come in on a non-UI thread, so it will need to be marshalled over. // Since doing that is an an async operation, a deferral will be required. Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { _currentPlayToImage = (Image)SelectedImageContainer.Content; if (_currentPlayToImage == null) { args.SourceRequest.DisplayErrorString("There is no image selected to be streamed."); } else { args.SourceRequest.SetSource(_currentPlayToImage.PlayToSource); } deferral.Complete(); }); }
private void OnPlayToSourceRequested(PlayToManager sender, PlayToSourceRequestedEventArgs args) { // This request will come in on a non-UI thread, // so it will need to be marshalled over. // Since doing that is an async operation, // a deferral will be required. var deferral = args.SourceRequest.GetDeferral(); Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { if (MediaElement.PlayToSource == null) { var errorMessage = "There is no video selected to be streamed."; args.SourceRequest.DisplayErrorString(errorMessage); } else { args.SourceRequest.SetSource(MediaElement.PlayToSource); } deferral.Complete(); }); }