public void Play(Item item, bool queue, bool intros) { if (item.IsPlayable || item.IsFolder) { currentPlaybackController = item.PlaybackController; if (queue) item.Queue(); else { //async this so it doesn't slow us down if the service isn't responding for some reason MediaBrowser.Library.Threading.Async.Queue("Cancel Svc Refresh", () => { MBServiceController.SendCommandToService(IPCCommands.CancelRefresh); //tell service to stop }); //put this on a thread so that we can run it sychronously, but not tie up the UI MediaBrowser.Library.Threading.Async.Queue("Play Action", () => { if (Application.CurrentInstance.RunPrePlayProcesses(item, intros)) { item.Play(); this.lastPlayed = item; } }); } } }
public void Play(Item item) { if (item.IsPlayable) { item.Play(); } else { Folder folder = item.BaseItem as Folder; if (folder != null) { var playableChildren = folder.RecursiveChildren.Select(i => i as Video).Where(v => v != null).OrderBy(v => v.Path); PlayableItem playable = new PlayableCollection(item.Name, playableChildren); playable.Play(null, false); } } }