internal static M3U8TagInstance Create(M3U8Tag tag, string value)
        {
            DateTimeOffset result;

            if (DateTimeOffset.TryParse(value, (IFormatProvider)CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal, out result))
            {
                return((M3U8TagInstance) new DateTimeTagInstance(tag, result));
            }
            Debug.WriteLine("*** unable to parse date/time: " + value);
            return((M3U8TagInstance)null);
        }
        internal static M3U8TagInstance Create(M3U8Tag tag, string value)
        {
            int length1 = value.IndexOf('@');

            if (length1 < 0 || length1 + 1 >= value.Length)
            {
                return((M3U8TagInstance) new ByterangeTagInstance(tag, long.Parse(value, (IFormatProvider)CultureInfo.InvariantCulture), new long?()));
            }
            long length2 = long.Parse(value.Substring(0, length1), (IFormatProvider)CultureInfo.InvariantCulture);
            long num     = long.Parse(value.Substring(length1 + 1), (IFormatProvider)CultureInfo.InvariantCulture);

            return((M3U8TagInstance) new ByterangeTagInstance(tag, length2, new long?(num)));
        }
Exemplo n.º 3
0
        internal static M3U8TagInstance Create(M3U8Tag tag, string value)
        {
            DateTimeOffset dateTimeOffset;

            if (!DateTimeOffset.TryParse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal, out dateTimeOffset))
            {
                Debug.WriteLine("*** unable to parse date/time: " + value);

                return null;
            }

            return new DateTimeTagInstance(tag, dateTimeOffset);
        }
Exemplo n.º 4
0
        internal static M3U8TagInstance Create(M3U8Tag tag, string value)
        {
            // TODO: Consolidate code between ByterangeAttributeInstance and ByterangeTagInstance

            var index = value.IndexOf('@');

            if (index < 0 || index + 1 >= value.Length)
                return new ByterangeTagInstance(tag, long.Parse(value, CultureInfo.InvariantCulture), null);

            var length = long.Parse(value.Substring(0, index), CultureInfo.InvariantCulture);
            var offset = long.Parse(value.Substring(index + 1), CultureInfo.InvariantCulture);

            return new ByterangeTagInstance(tag, length, offset);
        }
        internal static ExtinfTagInstance Create(M3U8Tag tag, string value)
        {
            if (string.IsNullOrWhiteSpace(value))
            {
                Debug.WriteLine("*** Invalid empty #EXTINF tag");
                return(new ExtinfTagInstance(tag, new Decimal(0), (string)null));
            }
            int length = value.IndexOf(',');

            if (length < 0)
            {
                return(new ExtinfTagInstance(tag, ExtinfTagInstance.ParseDuration(value), (string)null));
            }
            Decimal duration = ExtinfTagInstance.ParseDuration(value.Substring(0, length));
            string  title    = string.Empty;

            if (length + 1 < value.Length)
            {
                title = value.Substring(length + 1).Trim();
            }
            return(new ExtinfTagInstance(tag, duration, title));
        }
Exemplo n.º 6
0
 public static ExtKeyTagInstance Create(M3U8Tag tag, string value)
 {
     return new ExtKeyTagInstance(tag, ParseAttributes(value, ExtKeySupport.Attributes));
 }
Exemplo n.º 7
0
 internal ExtKeyTagInstance(M3U8Tag tag, IEnumerable<M3U8AttributeInstance> attributes)
     : base(tag, attributes)
 { }
Exemplo n.º 8
0
 public M3U8TagInstance(M3U8Tag tag)
 {
     this.Tag = tag;
 }
Exemplo n.º 9
0
 public ByterangeTagInstance(M3U8Tag tag, long length, long? offset)
     : base(tag)
 {
     Length = length;
     Offset = offset;
 }
Exemplo n.º 10
0
 ValueTagInstance(M3U8Tag tag, object value)
     : base(tag)
 {
     Value = value;
 }
Exemplo n.º 11
0
 public static ExtStreamInfTagInstance Create(M3U8Tag tag, string value)
 {
     return(new ExtStreamInfTagInstance(tag, AttributesTagInstance.ParseAttributes(value, ExtStreamInfSupport.Attributes)));
 }
Exemplo n.º 12
0
 internal static ValueTagInstance CreateLong(M3U8Tag tag, string value)
 {
     return(ValueTagInstance.Create(tag, value, (Func <string, object>)(v => (object)long.Parse(v, (IFormatProvider)CultureInfo.InvariantCulture))));
 }
Exemplo n.º 13
0
 internal static M3U8TagInstance Create(M3U8Tag tag, string value)
 {
     return((M3U8TagInstance) new MapTagInstance(tag));
 }
Exemplo n.º 14
0
 private MapTagInstance(M3U8Tag tag)
     : base(tag)
 {
 }
Exemplo n.º 15
0
 public ExtinfTagInstance(M3U8Tag tag, Decimal duration, string title = null)
     : base(tag)
 {
     this.Duration = duration;
     this.Title    = title ?? string.Empty;
 }
 private static M3U8TagInstance Create(M3U8Tag tag, string value, Func <string, IEnumerable <M3U8AttributeInstance> > attributeParser)
 {
     return((M3U8TagInstance) new AttributesTagInstance(tag, AttributesTagInstance.ParseAttributes(value, attributeParser)));
 }
 public static M3U8TagInstance Create(M3U8Tag tag, string value, IDictionary <string, M3U8Attribute> attributes)
 {
     return(AttributesTagInstance.Create(tag, value, (Func <string, IEnumerable <M3U8AttributeInstance> >)(v => M3U8AttributeParserSupport.ParseAttributes(v, attributes))));
 }
 internal AttributesTagInstance(M3U8Tag tag, IEnumerable <M3U8AttributeInstance> attributes)
     : base(tag)
 {
     this.Attributes = attributes;
 }
Exemplo n.º 19
0
 private ValueTagInstance(M3U8Tag tag, object value)
     : base(tag)
 {
     this.Value = value;
 }
 public DateTimeTagInstance(M3U8Tag tag, DateTimeOffset dateTime)
     : base(tag)
 {
     this.DateTime = dateTime;
 }
Exemplo n.º 21
0
 internal static ValueTagInstance Create(M3U8Tag tag, string value, Func <string, object> valueParser)
 {
     return(new ValueTagInstance(tag, valueParser(value)));
 }
Exemplo n.º 22
0
 internal static ValueTagInstance Create(M3U8Tag tag, string value, Func<string, object> valueParser)
 {
     return new ValueTagInstance(tag, valueParser(value));
 }
Exemplo n.º 23
0
 internal ExtStreamInfTagInstance(M3U8Tag tag, IEnumerable <M3U8AttributeInstance> attributes)
     : base(tag, attributes)
 {
 }
Exemplo n.º 24
0
 public DateTimeTagInstance(M3U8Tag tag, DateTimeOffset dateTime)
     : base(tag)
 {
     DateTime = dateTime;
 }
 public ByterangeTagInstance(M3U8Tag tag, long length, long?offset)
     : base(tag)
 {
     this.Length = length;
     this.Offset = offset;
 }
Exemplo n.º 26
0
 public static M3U8TagInstance CreateInstance(M3U8Tag tag, string value)
 {
     return(new M3U8TagInstance(tag));
 }
Exemplo n.º 27
0
 public M3U8TagInstance(M3U8Tag tag)
 {
     Tag = tag;
 }
Exemplo n.º 28
0
 internal static M3U8TagInstance Create(M3U8Tag tag, string value)
 {
     return new MapTagInstance(tag);
 }
Exemplo n.º 29
0
 internal AttributesTagInstance(M3U8Tag tag, IEnumerable<M3U8AttributeInstance> attributes)
     : base(tag)
 {
     Attributes = attributes;
 }
Exemplo n.º 30
0
 internal static ValueTagInstance CreateLong(M3U8Tag tag, string value)
 {
     return Create(tag, value, v => long.Parse(v, CultureInfo.InvariantCulture));
 }
Exemplo n.º 31
0
 public static M3U8TagInstance Create(M3U8Tag tag, string value, IDictionary<string, M3U8Attribute> attributes)
 {
     return Create(tag, value, v => M3U8AttributeParserSupport.ParseAttributes(v, attributes));
 }
Exemplo n.º 32
0
 static M3U8TagInstance Create(M3U8Tag tag, string value, Func<string, IEnumerable<M3U8AttributeInstance>> attributeParser)
 {
     return new AttributesTagInstance(tag, ParseAttributes(value, attributeParser));
 }
Exemplo n.º 33
0
 public static M3U8TagInstance CreateInstance(M3U8Tag tag, string value)
 {
     return new M3U8TagInstance(tag);
 }
Exemplo n.º 34
0
 MapTagInstance(M3U8Tag tag)
     : base(tag)
 { }