SelectBestFormat() публичный статический Метод

Returns the best format from the list in this order of availability: WebM, Mp4 or Flash. Mp4 will be chosen if WebM is over 35% smaller.
public static SelectBestFormat ( IEnumerable list ) : BestFormatInfo
list IEnumerable The list of videos to chose from.
Результат BestFormatInfo
Пример #1
0
 public async Task StartScan(List <VideoListItem> selection, CancellationToken cancel)
 {
     await selection.ForEachAsync(5, cancel, async item => {
         Media VideoData = PlayerAccess.GetVideoById(item.MediaId.Value);
         if (VideoData != null && !item.IsBusy)
         {
             try {
                 // Query the server for media info.
                 SetStatus(item, VideoListItemStatusEnum.DownloadingInfo);
                 VideoInfo VInfo = await DownloadManager.GetDownloadInfoAsync(VideoData.DownloadUrl);
                 if (VInfo != null)
                 {
                     // Get the highest resolution format.
                     BestFormatInfo VideoFormat = DownloadBusiness.SelectBestFormat(VInfo.Streams);
                     if (VideoFormat == null || VideoFormat.BestVideo == null)
                     {
                         SetStatus(item, VideoListItemStatusEnum.Failed);
                     }
                     else
                     {
                         SetStatus(item, await IsHigherQualityAvailable(VideoFormat, Settings.NaturalGroundingFolder + VideoData.FileName));
                     }
                     if (VideoFormat != null && !string.IsNullOrEmpty(VideoFormat.StatusText))
                     {
                         SetStatus(item, item.Status, item.StatusText + string.Format(" ({0})", VideoFormat.StatusText));
                     }
                 }
                 else
                 {
                     SetStatus(item, VideoListItemStatusEnum.InvalidUrl);
                 }
             }
             catch {
                 SetStatus(item, VideoListItemStatusEnum.Failed);
             }
         }
     });
 }