示例#1
0
        public URI CalcURL()
        {
            URI parent = Document.CalcURL();
            URI local  = URI.FromBaseURLs(BaseURLs);

            return(local == null ? parent : parent.With(local));
        }
示例#2
0
        private IRepresentationStream CreateBaseURLRepresentationStream()
        {
            Dynamic.TimeRange periodRange = null;
            if (Period.Start != null && Period.Duration != null)
            {
                periodRange = new Dynamic.TimeRange(Period.Start.Value, Period.Duration.Value);
            }

            URI media_uri = AdaptationSet.CalcURL();

            foreach (BaseURL url in BaseURLs)
            {
                if (!string.IsNullOrEmpty(url.BaseUrlValue))
                {
                    media_uri = media_uri.With(url.BaseUrlValue);
                }
            }

            Dynamic.SegmentBase segBase     = SegmentBase();
            var      presentationTimeOffset = segBase.PresentationTimeOffset ?? 0;
            TimeSpan availabilityTimeOffset = segBase.AvailabilityTimeOffset.HasValue ?
                                              TimeSpan.FromSeconds(segBase.AvailabilityTimeOffset.Value) : TimeSpan.MaxValue;

            // Live content elements from Segment Base...
            // Can we have this changing dynamically and available at given time?
            // God forbids...

            return(new Dynamic.BaseRepresentationStream(
                       null,
                       new Dynamic.Segment(media_uri.Uri, null, periodRange),
                       presentationTimeOffset, segBase.TimeShiftBufferDepth,
                       availabilityTimeOffset, segBase.AvailabilityTimeComplete));
        }
示例#3
0
        public URI CalcURL()
        {
            URI local = URI.FromBaseURLs(BaseURLs);

            return(manifestUrl?.With(local) ?? local ?? new URI());
        }