public void Play(PlayableItem playable) { CurrentlyPlayingItemId = playable.HasMediaItems ? playable.CurrentMedia.Id : CurrentItem.Id; MainPlayable = null; // just make sure this doesn't hang around Async.Queue(Async.ThreadPoolName.PlayAction, () => { currentPlaybackController = playable.PlaybackController; playable.Play(); }); }
/// <summary> /// Play with intros - this is an overload in order not to break sig with existing mcml /// </summary> /// <param name="playable"></param> /// <param name="introPlayable"></param> public void Play(PlayableItem playable, PlayableItem introPlayable) { if (BackdropController.IsPlaying) PlaybackControllerHelper.Stop(); if (introPlayable == null) { // Simulate optional param Play(playable); } else { CurrentlyPlayingItemId = playable.HasMediaItems ? playable.CurrentMedia.Id : CurrentItem.Id; Async.Queue(Async.ThreadPoolName.PlayIntros, () => { // save the main playable so we can play it when we're finished MainPlayable = playable; currentPlaybackController = introPlayable.PlaybackController; // hook to finished event so we can kick off the main introPlayable.PlaybackController.PlaybackFinished += IntroPlaybackFinished; RecentUserInput = false; SuppressInitialOverlay = true; // suppress the overlay for intros introPlayable.Play(); }); } }
internal void PlaySecure(PlayableItem playable) { Async.Queue("Play Action", () => { currentPlaybackController = playable.PlaybackController; playable.Play(); if (!playable.QueueItem) { //async this so it doesn't slow us down if the service isn't responding for some reason Async.Queue("Cancel Svc Refresh", () => { MBServiceController.SendCommandToService(IPCCommands.CancelRefresh); //tell service to stop }); } }); }
internal void PlaySecure(PlayableItem playable) { Async.Queue("Play Action", () => { currentPlaybackController = playable.PlaybackController; playable.Play(); }); }
/// <summary> /// Play with intros - this is an overload in order not to break sig with existing mcml /// </summary> /// <param name="playable"></param> /// <param name="introPlayable"></param> public void Play(PlayableItem playable, PlayableItem introPlayable) { if (BackdropController.IsPlaying) PlaybackControllerHelper.Stop(); if (introPlayable == null) { // Simulate optional param Play(playable); } else { CurrentlyPlayingItemId = playable.HasMediaItems ? playable.CurrentMedia.Id : CurrentItem.Id; Async.Queue("Play Intros", () => { // save the main playable so we can play it when we're finished MainPlayable = playable; currentPlaybackController = introPlayable.PlaybackController; // hook to finished event so we can kick off the main introPlayable.PlaybackController.PlaybackFinished += IntroPlaybackFinished; introPlayable.Play(); }); } }