public async void NotifyControllerStateChanged(MediaPlayerState state) { await DispatcherHelper.RunAsync(() => { switch (state) { case MediaPlayerState.Closed: CanPlay = CanPause = false; IsPlaying = false; PlaybackStatus = MediaPlaybackStatus.Closed; SuspendAskPosition(); break; case MediaPlayerState.Opening: CanPlay = CanPause = false; IsPlaying = false; PlaybackStatus = MediaPlaybackStatus.Changing; break; case MediaPlayerState.Buffering: CanPlay = CanPause = false; IsPlaying = false; PlaybackStatus = MediaPlaybackStatus.Changing; break; case MediaPlayerState.Playing: CanPause = true; CanPlay = true; IsPlaying = true; PlaybackStatus = MediaPlaybackStatus.Playing; ResumeAskPosition(); break; case MediaPlayerState.Paused: CanPause = false; CanPlay = true; IsPlaying = false; PlaybackStatus = MediaPlaybackStatus.Paused; SuspendAskPosition(); break; case MediaPlayerState.Stopped: PlaybackStatus = MediaPlaybackStatus.Stopped; SuspendAskPosition(); break; default: break; } }); }
public void UpdateSystemMediaTrasportControls( string title, string chapter, string coverPath = "", MediaPlaybackStatus mediaPlaybackStatus = MediaPlaybackStatus.Playing, bool isPLayEnabled = true, bool isNextEnabled = true, bool isPreviousEnabled = true, bool isPauseEnabled = true ) { speaker.UpdateSystemMediaTrasportControls( title, chapter, coverPath, mediaPlaybackStatus, isPLayEnabled, isNextEnabled, isPreviousEnabled, isPauseEnabled); }
public StatusChangedEventArgs(DbMediaFile currentItem, int currentIndex, MediaPlaybackStatus status) { CurrentIndex = currentIndex; CurrentItem = currentItem; Status = status; }