public static m3u8_file_t Parse(string content, Uri baseAddress) { var lines = from row in content.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries) let line = row.Trim() where (!line.IsNullOrEmpty() && !line.StartsWith("#")) select line ; var parts = lines.Select((line, i) => new m3u8_part_ts(line, i)); var o = new m3u8_file_t() { Parts = parts.ToList().AsReadOnly(), BaseAddress = baseAddress, RawText = content, }; return(o); }
public override void Output(m3u8_file_t m3u8File, IEnumerable <string> lines) { textBox.Lines = lines.ToArray(); textBox.AppendText($"\r\n\r\n patrs count: {m3u8File.Parts.Count}\r\n"); }