void TsMediaManagerOnStateChange(object sender, MediaManagerStateEventArgs mediaManagerStateEventArgs) { Dispatcher.BeginInvoke(() => { var message = mediaManagerStateEventArgs.Message; if (!string.IsNullOrWhiteSpace(message)) { errorBox.Text = message; errorBox.Visibility = Visibility.Visible; } UpdateState(); }); }
void TsMediaManagerOnStateChange(object sender, MediaManagerStateEventArgs mediaManagerStateEventArgs) { var awaiter = Dispatcher.RunAsync(CoreDispatcherPriority.Low, () => { var message = mediaManagerStateEventArgs.Message; if (!string.IsNullOrWhiteSpace(message)) { errorBox.Text = message; errorBox.Visibility = Visibility.Visible; } mediaElement1_CurrentStateChanged(null, null); }); TaskCollector.Default.Add(awaiter.AsTask(), "MainPage TsMediaManagerOnStateChange"); }
void MediaStreamFacadeOnStateChange(object sender, MediaManagerStateEventArgs args) { Debug.WriteLine("MediaPlayerManager.MediaStreamFacadeOnStateChange(): " + args.State + " message " + args.Message); }
void TsMediaManagerOnStateChange(object sender, MediaManagerStateEventArgs mediaManagerStateEventArgs) { var state = mediaManagerStateEventArgs.State; Debug.WriteLine("Media manager state in background agent: {0}, message: {1}", state, mediaManagerStateEventArgs.Message); if (null == _mediaStreamFacade) return; if (MediaManagerState.Closed == state || MediaManagerState.Error == state) { var cleanupTask = CleanupMediaStreamFacadeAsync(); TaskCollector.Default.Add(cleanupTask, "TsMediaManagerOnStateChange CleanupMediaStreamFacade"); } }