예제 #1
0
        void TsMediaManagerOnStateChange(object sender, MediaManagerStateEventArgs mediaManagerStateEventArgs)
        {
            Dispatcher.BeginInvoke(() =>
            {
                var message = mediaManagerStateEventArgs.Message;

                if (!string.IsNullOrWhiteSpace(message))
                {
                    errorBox.Text = message;
                    errorBox.Visibility = Visibility.Visible;
                }

                UpdateState();
            });
        }
예제 #2
0
        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");
        }
예제 #3
0
 void MediaStreamFacadeOnStateChange(object sender, MediaManagerStateEventArgs args)
 {
     Debug.WriteLine("MediaPlayerManager.MediaStreamFacadeOnStateChange(): " + args.State + " message " + args.Message);
 }
예제 #4
0
        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");
            }
        }