private async void receiver_StopRequested(PlayToReceiver recv, Object args) { await Dispatcher.RunAsync(CoreDispatcherPriority.High, () => { if (dmrVideo != null && currentType == MediaType.AudioVideo) { dmrVideo.Stop(); receiver.NotifyStopped(); } else if (dmrImage != null && currentType == MediaType.Image) { dmrImage.Source = null; receiver.NotifyStopped(); } }); }
private void HandleReceiverStopRequested(PlayToReceiver sender, Object args) { Dispatch(() => { if (_currentPlaybackType == PlaybackType.Video) { VideoPlayer.Stop(); // Receiver notification occurs in the HandleVideoPlayerCurrentStateChanged handler } else if (_currentPlaybackType == PlaybackType.Image) { ImagePlayer.Source = null; _receiver.NotifyStopped(); } }); }
async void receiver_StopRequested(PlayToReceiver sender, object args) { await Dispatcher.RunAsync(CoreDispatcherPriority.High, () => { MusicSource.Stop(); VideoSource.Stop(); receiver.NotifyStopped(); }); }