Constructor
new SegmentTemplate()
A set of functions for parsing SegmentTemplate elements.
- Source:
Methods
checkSegmentTemplateInfo_(context, info)
    Verifies a SegmentTemplate info object.
    Parameters:
| Name | Type | Description | 
|---|---|---|
| context | shaka.dash.DashParser.Context | |
| info | shaka.dash.SegmentTemplate.SegmentTemplateInfo | 
- Source:
createInitSegment_(context, aesKey) → {shaka.media.InitSegmentReference}
    Creates an init segment reference from a context object.
    Parameters:
| Name | Type | Description | 
|---|---|---|
| context | shaka.dash.DashParser.Context | |
| aesKey | shaka.extern.aesKey | undefined | 
- Source:
Returns:
createStreamInfo(context, requestSegment, streamMapnon-null, isUpdate, segmentLimit, periodDurationMapnon-null, aesKey, lastSegmentNumbernullable, isPatchUpdate, continuityCachenon-null) → {shaka.dash.DashParser.StreamInfo}
    Creates a new StreamInfo object.
Updates the existing SegmentIndex, if any.
    Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
| context | shaka.dash.DashParser.Context | ||
| requestSegment | shaka.dash.DashParser.RequestSegmentCallback | ||
| streamMap | Map<string, !shaka.extern.Stream> | ||
| isUpdate | boolean | True if the manifest is being updated. | |
| segmentLimit | number | The maximum number of segments to generate for a SegmentTemplate with fixed duration. | |
| periodDurationMap | Map<string, number> | ||
| aesKey | shaka.extern.aesKey | undefined | ||
| lastSegmentNumber | number | <nullable> | |
| isPatchUpdate | boolean | ||
| continuityCache | Map<string, {endTime: number, timeline: number, reps: Array<string>}> | 
- Source:
Returns:
fromInheritance_(framenullable) → {shaka.extern.xml.Node}
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
| frame | shaka.dash.DashParser.InheritanceFrame | <nullable> | 
- Source:
Returns:
generateSegmentIndexFromDuration_(context, info, segmentLimit, initSegmentReference, periodDurationMapnon-null, aesKey, lastSegmentNumbernullable, segmentSequenceCadence) → {Promise<shaka.media.SegmentIndex>}
    Generates a SegmentIndex from fixed-duration segments.
    Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
| context | shaka.dash.DashParser.Context | ||
| info | shaka.dash.SegmentTemplate.SegmentTemplateInfo | ||
| segmentLimit | number | The maximum number of segments to generate. | |
| initSegmentReference | shaka.media.InitSegmentReference | ||
| periodDurationMap | Map<string, number> | ||
| aesKey | shaka.extern.aesKey | undefined | ||
| lastSegmentNumber | number | <nullable> | |
| segmentSequenceCadence | number | 
- Source:
Returns:
- Type
- Promise<shaka.media.SegmentIndex>
generateSegmentIndexFromIndexTemplate_(context, requestSegment, init, info) → {Promise<shaka.media.SegmentIndex>}
    Generates a SegmentIndex from an index URL template.
    Parameters:
| Name | Type | Description | 
|---|---|---|
| context | shaka.dash.DashParser.Context | |
| requestSegment | shaka.dash.DashParser.RequestSegmentCallback | |
| init | shaka.media.InitSegmentReference | |
| info | shaka.dash.SegmentTemplate.SegmentTemplateInfo | 
- Source:
Returns:
- Type
- Promise<shaka.media.SegmentIndex>
modifyTimepoints(contextnon-null, patchNode)
    Ingests Patch MPD segments into timeline.
    Parameters:
| Name | Type | Description | 
|---|---|---|
| context | shaka.dash.DashParser.Context | |
| patchNode | shaka.extern.xml.Node | 
- Source:
parseSegmentTemplateInfo_(context) → {shaka.dash.SegmentTemplate.SegmentTemplateInfo}
    Parses a SegmentTemplate element into an info object.
    Parameters:
| Name | Type | Description | 
|---|---|---|
| context | shaka.dash.DashParser.Context | 
- Source:
Returns:
removeTimepoints(contextnon-null)
    Removes all segments from timeline.
    Parameters:
| Name | Type | Description | 
|---|---|---|
| context | shaka.dash.DashParser.Context | 
- Source:
Type Definitions
SegmentTemplateInfo
    Contains information about a SegmentTemplate.
    Type:
- {timescale: number, unscaledSegmentDuration: ?number, segmentDuration: ?number, startNumber: number, scaledPresentationTimeOffset: number, unscaledPresentationTimeOffset: number, timeline: Array<shaka.media.PresentationTimeline.TimeRange>, mediaTemplate: ?string, indexTemplate: ?string, mimeType: string, codecs: string, bandwidth: number, numChunks: number}
Properties:
| Name | Type | Attributes | Description | 
|---|---|---|---|
| timescale | number | The time-scale of the representation. | |
| unscaledSegmentDuration | number | <nullable> | The duration of the segments in seconds, in timescale units. | 
| segmentDuration | number | <nullable> | The duration of the segments in seconds, if given. | 
| startNumber | number | The start number of the segments; 1 or greater. | |
| scaledPresentationTimeOffset | number | The presentation time offset of the representation, in seconds. | |
| unscaledPresentationTimeOffset | number | The presentation time offset of the representation, in timescale units. | |
| timeline | Array<shaka.media.PresentationTimeline.TimeRange> | The timeline of the representation, if given. Times in seconds. | |
| mediaTemplate | string | <nullable> | The media URI template, if given. | 
| indexTemplate | string | <nullable> | The index URI template, if given. | 
| mimeType | string | The mimeType. | |
| codecs | string | The codecs. | |
| bandwidth | number | The bandwidth. | |
| numChunks | number | The number of chunks in each segment. | 
- Source: