Esempio n. 1
0
        private static void Player_MediaStateChanged(object sender, Events.MediaStateChangedEventArgs e)
        {
            if (_smtc != null)
            {
                switch (e.NewState)
                {
                case PlayerState.Playing:
                    _smtc.PlaybackStatus = MediaPlaybackStatus.Playing;
                    if (_smtc.IsEnabled == false)
                    {
                        if (update)
                        {
                            UpdateSmtc(true);
                            update = false;
                            player.Pause();
                        }
                    }
                    break;

                case PlayerState.Paused:
                    _smtc.PlaybackStatus = MediaPlaybackStatus.Paused;
                    break;

                case PlayerState.Stopped:
                    _smtc.PlaybackStatus = MediaPlaybackStatus.Stopped;
                    break;

                default:
                    break;
                }
            }
        }
Esempio n. 2
0
        private static void Player_MediaStateChanged(object sender, Events.MediaStateChangedEventArgs e)
        {
            if (_smtc != null)
            {
                switch (e.NewState)
                {
                case PlayerState.Playing:
                    _smtc.PlaybackStatus = MediaPlaybackStatus.Playing;
                    break;

                case PlayerState.Paused:
                    _smtc.PlaybackStatus = MediaPlaybackStatus.Paused;
                    break;

                case PlayerState.Stopped:
                    _smtc.PlaybackStatus = MediaPlaybackStatus.Stopped;
                    break;

                default:
                    break;
                }
            }
        }