示例#1
0
        public void Render(StreamWriter writer)
        {
            writer.Write($"#EXT-X-KEY:METHOD={EncryptionKind}");

            if (Uri != null)
            {
                writer.Write($",URI=\"{Uri}\"");
            }

            if (IV != null)
            {
                writer.Write($",IV=\"{IV}\"");
            }

            if (KeyFormat != null)
            {
                writer.Write($",KEYFORMAT=\"{KeyFormat}\"");
            }

            if (KeyFormatVersions != null)
            {
                writer.Write($",KEYFORMATVERSIONS=\"{string.Join("/", KeyFormatVersions)}\"");
            }

            writer.AppendNormalizedNewline();
        }
示例#2
0
        public void Render(StreamWriter writer)
        {
            var builder = new StringBuilder();

            writer.Write($"#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH={Bandwidth},URI=\"{Uri}\"");

            if (AverageBandwidth.HasValue)
            {
                writer.Write($",AVERAGE-BANDWIDTH={AverageBandwidth.Value}");
            }

            if (Codecs != null)
            {
                writer.Write($",CODECS=\"{string.Join(",", Codecs)}\"");
            }

            if (Resolution.HasValue)
            {
                writer.Write($",RESOLUTION={Resolution.Value.Width}x{Resolution.Value.Height}");
            }

            if (Video != null)
            {
                writer.Write($",VIDEO=\"{Video}\"");
            }

            writer.AppendNormalizedNewline();
        }
示例#3
0
        public void Render(StreamWriter writer)
        {
            writer.Write(FormattableString.Invariant($"#EXT-X-START:TIME-OFFSET={Offset.TotalSeconds}"));

            if (IsPrecise.HasValue && IsPrecise.Value)
            {
                writer.Write(",PRECISE=YES");
            }

            writer.AppendNormalizedNewline();
        }
示例#4
0
        public void Render(StreamWriter writer)
        {
            writer.Write($"#EXT-X-RENDITION-REPORT:URI=\"{Path}\",LAST-MSN={LastMsn}");

            if (LastPart.HasValue)
            {
                writer.Write($",LAST-PART={LastPart.Value}");
            }

            writer.AppendNormalizedNewline();
        }
示例#5
0
文件: Map.cs 项目: Vannevelj/fast-hls
        public void Render(StreamWriter writer)
        {
            var builder = new StringBuilder();

            writer.Write($"#EXT-X-MAP:URI=\"{Uri}\"");

            if (ByteRange.HasValue)
            {
                writer.Write($",BYTERANGE=\"{ByteRange.Value}\"");
            }

            writer.AppendNormalizedNewline();
        }
示例#6
0
        public void Render(StreamWriter writer)
        {
            writer.Write($"#EXT-X-PRELOAD-HINT:TYPE={Type},URI=\"{Path}\"");

            if (Start.HasValue)
            {
                writer.Write($",BYTERANGE-START=\"{Start.Value}\"");
            }

            if (Length.HasValue)
            {
                writer.Write($",BYTERANGE-LENGTH=\"{Length.Value}\"");
            }

            writer.AppendNormalizedNewline();
        }
示例#7
0
        public void Render(StreamWriter writer)
        {
            writer.Write($"#EXT-X-MEDIA:TYPE={MediaType},GROUP-ID=\"{GroupId}\",NAME=\"{Name}\"");

            if (Language != null)
            {
                writer.Write($",LANGUAGE=\"{Language}\"");
            }

            if (AssocLanguage != null)
            {
                writer.Write($",ASSOC-LANGUAGE=\"{AssocLanguage}\"");
            }

            if (IsDefault)
            {
                writer.Write(",DEFAULT=YES");
            }

            if (AutoSelect)
            {
                writer.Write(",AUTOSELECT=YES");
            }

            if (Forced)
            {
                writer.Write(",FORCED=YES");
            }

            if (InstreamId != null)
            {
                writer.Write($",INSTREAM-ID=\"{InstreamId}\"");
            }

            if (Characteristics != null)
            {
                writer.Write($",CHARACTERISTICS=\"{string.Join(",", Characteristics)}\"");
            }

            if (Uri != null)
            {
                writer.Write($",URI=\"{Uri}\"");
            }

            writer.AppendNormalizedNewline();
        }
示例#8
0
        public void Render(StreamWriter writer)
        {
            writer.Write($"#EXT-X-STREAM-INF:BANDWIDTH={Bandwidth}");

            if (AverageBandwidth.HasValue)
            {
                writer.Write($",AVERAGE-BANDWIDTH={AverageBandwidth.Value}");
            }

            if (Codecs != null)
            {
                writer.Write($",CODECS=\"{string.Join(",", Codecs)}\"");
            }

            if (Resolution.HasValue)
            {
                writer.Write($",RESOLUTION={Resolution.Value.Width}x{Resolution.Value.Height}");
            }

            if (Audio != null)
            {
                writer.Write($",AUDIO=\"{Audio}\"");
            }

            if (Video != null)
            {
                writer.Write($",VIDEO=\"{Video}\"");
            }

            if (Subtitles != null)
            {
                writer.Write($",SUBTITLES=\"{Subtitles}\"");
            }

            if (ClosedCaptions != null)
            {
                writer.Write($",CLOSED-CAPTIONS=\"{ClosedCaptions}\"");
            }

            writer.AppendNormalizedNewline();
            writer.AppendNormalizedline(Uri);
        }
示例#9
0
        public void Render(StreamWriter writer)
        {
            writer.Write($"#EXT-X-PART:DURATION={Duration},URI=\"{Path}\"");

            if (IsIndependent.HasValue)
            {
                writer.Write($",INDEPENDENT={( IsIndependent.Value ? "YES" : "NO" )}");
            }

            if (ByteRange.HasValue)
            {
                writer.Write($",BYTERANGE={ByteRange.Value}");
            }

            if (HasGap.HasValue)
            {
                writer.Write($",GAP={( HasGap.Value ? "YES" : "NO" )}");
            }

            writer.AppendNormalizedNewline();
        }
示例#10
0
        public void Render(StreamWriter writer)
        {
            writer.Write($"#EXT-X-SESSION-DATA:DATA-ID=\"{DataId}\"");

            if (Value != null)
            {
                writer.Write($",VALUE=\"{Value}\"");
            }

            if (Uri != null)
            {
                writer.Write($",URI=\"{Uri}\"");
            }

            if (Language != null)
            {
                writer.Write($",LANGUAGE=\"{Language}\"");
            }

            writer.AppendNormalizedNewline();
        }