Пример #1
0
        string addHlsPlaybackOption(HlsStreamInfo streamInfo, CookieCollection cookies, Dictionary <string, string> playbackOptions)
        {
            HttpUrl url = new HttpUrl(streamInfo.Url);

            url.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36";
            url.Cookies.Add(cookies);
            string urlString = url.ToString();
            string name      = string.Format("{0}x{1} | {2} kbps", streamInfo.Width, streamInfo.Height, streamInfo.Bandwidth / 1024);

            playbackOptions[name] = url.ToString();
            return(urlString);
        }
Пример #2
0
 string populateHlsPlaybackOptions(VideoInfo video, List <HlsStreamInfo> streamInfos)
 {
     if (AutoSelectStream)
     {
         HlsStreamInfo streamInfo = streamInfos.Last();
         string        name       = string.Format("{0}x{1} | {2} kbps", streamInfo.Width, streamInfo.Height, streamInfo.Bandwidth / 1024);
         video.PlaybackOptions.Add(name, streamInfo.Url);
         return(streamInfo.Url);
     }
     else
     {
         foreach (HlsStreamInfo streamInfo in streamInfos)
         {
             string name = string.Format("{0}x{1} | {2} kbps", streamInfo.Width, streamInfo.Height, streamInfo.Bandwidth / 1024);
             video.PlaybackOptions.Add(name, streamInfo.Url);
         }
         return(streamInfos.Last().Url);
     }
 }
Пример #3
0
 public ResolvableStream(Uri uri, HlsStreamInfo stream)
 {
     _uri    = uri;
     _stream = stream;
 }