Example #1
0
        public static async Task <CSTube.Video> FetchPTVideoDataAsync(MediaItem item)
        {
            CSTube.Video videoData = await CSTube.Video.Fetch(item.URL, false);

            item.UpdateFromCTVideo(videoData);
            return(videoData);
        }
Example #2
0
        public static MediaItem fromCTVideo(CSTube.Video video)
        {
            MediaItem music = new MediaItem();

            music.UpdateFromCTVideo(video);
            return(music);
        }
Example #3
0
        private async void OnFetchFromURL(object sender, RoutedEventArgs e)
        {
            string URL = URLInputTextBox.Text;

            if (CSTube.Extract.isVideoURL(URL))
            {             // Record as music item
                CSTube.Video video = new CSTube.Video(URL);
                MediaItem    item  = MediaItem.fromCTVideo(video);
                curMediaList.Add(item);
                UpdateMediaList();
                // Fetch music data and update list once ready
                await video.FetchInformation();

                item.UpdateFromCTVideo(video);
                UpdateMediaList();
            }
            else if (CSTube.Extract.isPlaylistURL(URL))
            {             // Fetch playlist items and record them, then continuously update them
                Debug.Log("Cannot load all playlist videos yet, Google API implementation missing!");
            }
            else
            {
                Debug.Log("ERROR: URL does not point to a valid youtube video!");
            }
        }