public static async Task<M3U8Playlist> GetStreamPlaylist(string Channel, AccessToken accessToken) { Uri m3u8_path = new Uri(string.Format(PathStrings.M3U8_PATH, Channel, accessToken.Token, accessToken.Signature)); indexUri = m3u8_path; var request = HttpWebRequest.Create(m3u8_path); request.Method = "GET"; var response = await HttpRequest(request); if (response == null) return null; return new M3U8Playlist { streams = GetStreamsFromM3U8(response) }; }
public PlayerPage() { token = new AccessToken(); playlist = new M3U8Playlist(); InitializeComponent(); uiTimeout = new DispatcherTimer(); uiTimeout.Interval = new TimeSpan(0, 0, 4); uiTimeout.Tick += uiTimeout_Tick; chatGoToBottom = new DispatcherTimer(); chatGoToBottom.Interval = new TimeSpan(0, 0, 3); chatGoToBottom.Tick += chatGoToBottom_Tick; backgroundWorker.DoWork += backgroundWorker_DoWork; backgroundWorker.ProgressChanged += backgroundWorker_ProgressChanged; backgroundWorker.WorkerReportsProgress = true; }