Exemple #1
0
        private async void RetrieveVideoSize(YouTubeVideo ytv)
        {
            cbxFormat.IsEnabled     = false;
            cbxResolution.IsEnabled = false;
            lblVideoSize.Content    = "Getting size...";
            try {
                YouTubeVideo.DownloadInfo dlInfo = GetDownloadInfo(ytv,
                                                                   cbxFormat.SelectedValue as string, cbxResolution.SelectedValue as string);
                FileSize sz = await YouTubeVideo.GetVideoSizeAsync(dlInfo);

                lblVideoSize.Content = sz.ToString();
            }
            catch {
                lblVideoSize.Content = "Unable to get size.";
            }
            finally {
                cbxFormat.IsEnabled     = true;
                cbxResolution.IsEnabled = true;
            }
        }