public abstract IEnumerable<XSegment> GetPlaylist(SubStream audio = null);
public override IEnumerable<XSegment> GetPlaylist(SubStream audio = null) { return _segments; }
public override IEnumerable<XSegment> GetPlaylist(SubStream audio = null) { var playlist = Playlist; if (null == playlist) yield break; var parser = new M3U8Parser(); using (var f = new WebClient().OpenRead(playlist)) { parser.Parse(playlist, f); Uri previous = null; foreach (var p in parser.Playlist) { var url = new Uri(playlist, new Uri(p.Uri, UriKind.RelativeOrAbsolute)); if (null != previous && url == previous) continue; yield return new XSegment { Url = url }; previous = url; } } }