/// <summary> /// Starts a chunk download /// </summary> /// <param name="sender">the object that sent this event</param> /// <param name="args">event args for the download event</param> private void StartChunkDownload(object sender, Heuristics.RequestDownloadEventArgs args) { StreamInfo streamInfo = m_manifestInfo.GetStreamInfoForStream(args.StreamId); FireOnDownloadBitrateChange(streamInfo.MediaType, args.Bitrate, DateTime.Now); MediaChunk chunk = streamInfo.Queue[args.ChunkId]; if (chunk.Bitrate != args.Bitrate) { chunk.Bitrate = args.Bitrate; } Downloader.Start(streamInfo.BaseUrl, UrlGenerator, chunk, ReportDownloadComplete, m_heuristics.InstanceId); }
/// <summary> /// Fire a downloads paused event /// </summary> /// <param name="sender">object which is sending this event</param> /// <param name="args">downloads paused event args</param> private void FireDownloadsPaused(object sender, Heuristics.DownloadsPausedEventArgs args) { if (DownloadsPaused != null) { UIDispatcher.Schedule(new EventHandler<DownloadPausedEventArgs>(DownloadsPaused), this, args.StartTime); } }