private void SpliteM3U8(string m3u8Response) { var matches = ReGeXHelper.GetResList(m3u8Response, @"#EXTINF:(.*)?,\n(.*?\.ts)"); //获取所有的ts片段信息 matches.ForEach(m => { TsTimes.Add(m?.Groups[1].Value); TsPaths.Add(m?.Groups[2].Value); }); }
/// <summary> /// 判断是否是多码率 /// </summary> /// <returns></returns> private bool IsMutiple() { //#EXT-X-STREAM-INF.*?\n(.*) var inf = ReGeXHelper.GetResList(M3U8Response, @"#EXT-X-STREAM-INF.*?\n(.*)"); if (inf.Count != 0) { M3U8Url = ApplyURL(inf[0].Groups[1].Value, M3U8Url); RequestM3U8(); return(true); } return(false); }