/// <summary> /// Plays the media /// </summary> public virtual void Play() { MediaPlayerBase.EnsureThread(DefaultApartmentState); MediaPlayerBase.Dispatcher.BeginInvoke((Action)(delegate { MediaPlayerBase.Play(); Dispatcher.BeginInvoke(((Action)(() => SetIsPlaying(true)))); })); }
/// <summary> /// Pauses the media /// </summary> public virtual void Pause() { MediaPlayerBase.EnsureThread(DefaultApartmentState); MediaPlayerBase.Dispatcher.BeginInvoke((Action)(() => MediaPlayerBase.Pause())); SetIsPlaying(false); }
protected void EnsurePlayerThread() { MediaPlayerBase.EnsureThread(DefaultApartmentState); }