void player_PlayBegin(YoutubePlaylistPlayer playlit, PlayListItem item) { try { //ClearLabels("NowPlaying"); VideoInfo info = item.MusicTag as VideoInfo; if (info == null) { return; } Log.Debug("YouTube.fm playback started"); YouTubeEntry en = info.Entry; if (en.Authors.Count == 0) { Uri videoEntryUrl = new Uri("http://gdata.youtube.com/feeds/api/videos/" + Youtube2MP.GetVideoId(en)); try { Video video = Youtube2MP.request.Retrieve <Video>(videoEntryUrl); en = video.YouTubeEntry; } catch (Exception) { //vid = null; } } en.Title.Text = item.Description; item.FileName = Youtube2MP.StreamPlaybackUrl(en, info); ClearLabels("NowPlaying", true); ClearLabels("Next", true); Youtube2MP.NowPlayingEntry = en; Youtube2MP.NextPlayingEntry = null; //ArtistManager.Instance.SetSkinProperties(Youtube2MP.NextPlayingEntry, "NowPlaying", false, false); if (playlit.GetNextItem() != null) { VideoInfo nextinfo = playlit.GetNextItem().MusicTag as VideoInfo; if (nextinfo != null) { Youtube2MP.NextPlayingEntry = nextinfo.Entry; //ArtistManager.Instance.SetSkinProperties(Youtube2MP.NextPlayingEntry, "Next", false, false); } } BackgroundWorker playBeginWorker = new BackgroundWorker(); playBeginWorker.DoWork += playBeginWorker_DoWork; playBeginWorker.RunWorkerAsync(); Youtube2MP.YouTubePlaying = true; GUIPropertyManager.SetProperty("#Youtube.fm.FullScreen.ShowTitle", "true"); GUIPropertyManager.SetProperty("#Youtube.fm.FullScreen.ShowNextTitle", Youtube2MP.NextPlayingEntry != null ? "true" : "false"); _labelTimer.Stop(); _labelTimer.Start(); } catch (Exception exception) { Log.Error("Youtube play begin exception"); Log.Error(exception); } }
void player_PlayBegin(YoutubePlaylistPlayer playlit, PlayListItem item) { try { //ClearLabels("NowPlaying"); VideoInfo info = item.MusicTag as VideoInfo; if (info == null) return; Log.Debug("YouTube.fm playback started"); YouTubeEntry en = info.Entry; if (en.Authors.Count == 0) { Uri videoEntryUrl = new Uri("http://gdata.youtube.com/feeds/api/videos/" + Youtube2MP.GetVideoId(en)); try { Video video = Youtube2MP.request.Retrieve<Video>(videoEntryUrl); en = video.YouTubeEntry; } catch (Exception) { //vid = null; } } en.Title.Text = item.Description; item.FileName = Youtube2MP.StreamPlaybackUrl(en, info); ClearLabels("NowPlaying",true); ClearLabels("Next", true); Youtube2MP.NowPlayingEntry = en; Youtube2MP.NextPlayingEntry = null; //ArtistManager.Instance.SetSkinProperties(Youtube2MP.NextPlayingEntry, "NowPlaying", false, false); if (playlit.GetNextItem() != null) { VideoInfo nextinfo = playlit.GetNextItem().MusicTag as VideoInfo; if (nextinfo != null) { Youtube2MP.NextPlayingEntry = nextinfo.Entry; //ArtistManager.Instance.SetSkinProperties(Youtube2MP.NextPlayingEntry, "Next", false, false); } } BackgroundWorker playBeginWorker = new BackgroundWorker(); playBeginWorker.DoWork += playBeginWorker_DoWork; playBeginWorker.RunWorkerAsync(); Youtube2MP.YouTubePlaying = true; GUIPropertyManager.SetProperty("#Youtube.fm.FullScreen.ShowTitle", "true"); GUIPropertyManager.SetProperty("#Youtube.fm.FullScreen.ShowNextTitle", Youtube2MP.NextPlayingEntry != null ? "true" : "false"); _labelTimer.Stop(); _labelTimer.Start(); } catch (Exception exception) { Log.Error("Youtube play begin exception"); Log.Error(exception); } }