Class: shaka.dash.MpdProcessor

Constructor

new MpdProcessor(interpretContentProtectionnullable)

Creates an MpdProcessor, which validates MPDs, calculates start, duration, and other missing attributes, removes invalid Periods, AdaptationSets, and Representations, and ultimately generates a ManifestInfo.
Parameters:
Name Type Attributes Description
interpretContentProtection shaka.player.DashVideoSource.ContentProtectionCallback <nullable>
Source:

Members

(static, constant) DEFAULT_MIN_BUFFER_TIME :number

The default value, in seconds, for MPD@minBufferTime if this attribute is missing.
Type:
  • number
Source:

(private, nullable) interpretContentProtection_ :shaka.player.DashVideoSource.ContentProtectionCallback

Type:
Source:

Methods

(private) calculateDurations_(mpdnon-null)

Attempts to calculate each Period's start attribute and duration attribute, and attempts to calcuate the MPD's mediaPresentationDuration attribute.
Parameters:
Name Type Description
mpd shaka.dash.mpd.Mpd
Source:
See:
  • ISO/IEC 23009-1:2014 section 5.3.2.1

(private) createDrmInfos_(contentProtectionnon-null) → (non-null) {Array.<!shaka.player.DrmInfo>}

Parameters:
Name Type Description
contentProtection shaka.dash.mpd.ContentProtection
Source:
Returns:
Type
Array.<!shaka.player.DrmInfo>

(private) createManifestInfo_(mpdnon-null, manifestCreationTime, networkCallback) → (non-null) {shaka.media.ManifestInfo}

Creates a ManifestInfo from |mpd|.
Parameters:
Name Type Description
mpd shaka.dash.mpd.Mpd
manifestCreationTime number The time, in seconds, when the manifest was created.
networkCallback shaka.util.FailoverUri.NetworkCallback
Source:
Returns:
Type
shaka.media.ManifestInfo

(private) createPeriodInfo_(mpdnon-null, periodnon-null, manifestCreationTime, networkCallback) → (non-null) {shaka.media.PeriodInfo}

Creates a PeriodInfo.
Parameters:
Name Type Description
mpd shaka.dash.mpd.Mpd
period shaka.dash.mpd.Period
manifestCreationTime number The time, in seconds, when the manifest was created.
networkCallback shaka.util.FailoverUri.NetworkCallback
Source:
Returns:
Type
shaka.media.PeriodInfo

(private) createSegmentMetadata_(urlTypeObject, networkCallback) → (non-null) {shaka.util.FailoverUri}

Creates a SegmentMetadata from either a RepresentationIndex or an Initialization.
Parameters:
Name Type Description
urlTypeObject shaka.dash.mpd.RepresentationIndex | shaka.dash.mpd.Initialization
networkCallback shaka.util.FailoverUri.NetworkCallback
Source:
Returns:
Type
shaka.util.FailoverUri

(private) createStreamInfo_(mpdnon-null, periodnon-null, representationnon-null, manifestCreationTime, networkCallback) → {shaka.media.StreamInfo}

Creates a StreamInfo from the given Representation.
Parameters:
Name Type Description
mpd shaka.dash.mpd.Mpd
period shaka.dash.mpd.Period
representation shaka.dash.mpd.Representation
manifestCreationTime number The time, in seconds, when the manifest was created.
networkCallback shaka.util.FailoverUri.NetworkCallback
Source:
Returns:
The new StreamInfo on success; otherwise, return null.
Type
shaka.media.StreamInfo

(private) createStreamInfoFromSegmentBase_(mpdnon-null, periodnon-null, representationnon-null, manifestCreationTime, networkCallback) → {shaka.media.StreamInfo}

Creates a StreamInfo from a SegmentBase.
Parameters:
Name Type Description
mpd shaka.dash.mpd.Mpd
period shaka.dash.mpd.Period
representation shaka.dash.mpd.Representation
manifestCreationTime number The time, in seconds, when the manifest was created.
networkCallback shaka.util.FailoverUri.NetworkCallback
Source:
Returns:
A streamInfo on success; otherwise, return null.
Type
shaka.media.StreamInfo

(private) createStreamInfoFromSegmentList_(mpdnon-null, periodnon-null, representationnon-null, manifestCreationTime, networkCallback) → {shaka.media.StreamInfo}

Creates a StreamInfo from a SegmentList.
Parameters:
Name Type Description
mpd shaka.dash.mpd.Mpd
period shaka.dash.mpd.Period
representation shaka.dash.mpd.Representation
manifestCreationTime number The time, in seconds, when the manifest was created.
networkCallback shaka.util.FailoverUri.NetworkCallback
Source:
Returns:
A StreamInfo on success; otherwise, return null.
Type
shaka.media.StreamInfo

(private) createStreamInfoFromSegmentTemplate_(mpdnon-null, periodnon-null, representationnon-null, manifestCreationTime, networkCallback) → {shaka.media.StreamInfo}

Creates a StreamInfo from a SegmentTemplate
Parameters:
Name Type Description
mpd shaka.dash.mpd.Mpd
period shaka.dash.mpd.Period
representation shaka.dash.mpd.Representation
manifestCreationTime number The time, in seconds, when the manifest was created.
networkCallback shaka.util.FailoverUri.NetworkCallback
Source:
Returns:
A StreamInfo on success; otherwise, return null.
Type
shaka.media.StreamInfo

(private) createStreamSetInfo_(mpdnon-null, periodnon-null, adaptationSets, manifestCreationTime, networkCallback) → (non-null) {shaka.media.StreamSetInfo}

Creates a StreamSetInfo from AdaptationSets of the same type, group, and language.
Parameters:
Name Type Description
mpd shaka.dash.mpd.Mpd
period shaka.dash.mpd.Period
adaptationSets Array.<!shaka.dash.mpd.AdaptationSet> AdaptationSets from the same group.
manifestCreationTime number The time, in seconds, when the manifest was created.
networkCallback shaka.util.FailoverUri.NetworkCallback
Source:
Returns:
Type
shaka.media.StreamSetInfo

(private) filterAdaptationSet_(adaptationSetnon-null)

Removes any Representation from the given AdaptationSet that has a different MIME type than the MIME type of the first Representation of the AdaptationSet.
Parameters:
Name Type Description
adaptationSet shaka.dash.mpd.AdaptationSet
Source:

(private) filterPeriods_(mpdnon-null)

Removes invalid Representations from |mpd|.
Parameters:
Name Type Description
mpd shaka.dash.mpd.Mpd
Source:

(private) findLowestQualityAdaptationSet_(adaptationSetsnon-null) → {shaka.dash.mpd.AdaptationSet}

Returns the AdaptationSet that contains the lowest quality Representation.
Parameters:
Name Type Description
adaptationSets Array.<!shaka.dash.mpd.AdaptationSet>
Source:
Returns:
Type
shaka.dash.mpd.AdaptationSet

(private) generateInitialization_(representationnon-null) → {shaka.dash.mpd.Initialization}

Generates an Initialization from a SegmentTemplate.
Parameters:
Name Type Description
representation shaka.dash.mpd.Representation
Source:
Returns:
An Initialization on success; otherwise return null if no initialization URL template exists or an error occurred.
Type
shaka.dash.mpd.Initialization

(private) generateRepresentationIndex_(representationnon-null) → {shaka.dash.mpd.RepresentationIndex}

Generates a RepresentationIndex from a SegmentTemplate.
Parameters:
Name Type Description
representation shaka.dash.mpd.Representation
Source:
Returns:
A RepresentationIndex on success; otherwise, return null if no index URL template exists or an error occurred.
Type
shaka.dash.mpd.RepresentationIndex

(private) generateUrlTypeObject_(representationnon-null, urlTemplate, constructornon-null) → {T}

Generates either an Initialization or a RepresentationIndex.
Parameters:
Name Type Description
representation shaka.dash.mpd.Representation
urlTemplate string
constructor !function(new:T)
Source:
Returns:
Type
T

(private) getDrmInfos_(representationnon-null) → (non-null) {Array.<!shaka.player.DrmInfo>}

Gets the application provided DrmInfos for the given Representation.
Parameters:
Name Type Description
representation shaka.dash.mpd.Representation
Source:
Returns:
The application provided DrmInfos. A dummy DrmInfo, which has an empty |keySystem| string, is used for unencrypted content.
Type
Array.<!shaka.player.DrmInfo>

(private) makeSegmentIndexSourceViaIndexUrlTemplate_(mpdnon-null, periodnon-null, representationnon-null, manifestCreationTime, initMetadata, networkCallback) → {shaka.media.ISegmentIndexSource}

Creates an ISegmentIndexSource from a SegmentTemplate with an index URL template.
Parameters:
Name Type Description
mpd shaka.dash.mpd.Mpd
period shaka.dash.mpd.Period
representation shaka.dash.mpd.Representation
manifestCreationTime number The time, in seconds, when the manifest was created.
initMetadata shaka.util.FailoverUri
networkCallback shaka.util.FailoverUri.NetworkCallback
Source:
Returns:
A SegmentIndexSource on success; otherwise, return null.
Type
shaka.media.ISegmentIndexSource

(private) makeSegmentIndexSourceViaSegmentTemplate_(mpdnon-null, periodnon-null, representationnon-null, manifestCreationTime, initMetadata, networkCallback) → {shaka.media.ISegmentIndexSource}

Creates an ISegmentIndexSource from a SegmentTemplate.
Parameters:
Name Type Description
mpd shaka.dash.mpd.Mpd
period shaka.dash.mpd.Period
representation shaka.dash.mpd.Representation
manifestCreationTime number The time, in seconds, when the manifest was created.
initMetadata shaka.util.FailoverUri
networkCallback shaka.util.FailoverUri.NetworkCallback
Source:
Returns:
A SegmentIndexSource on success; otherwise, return null.
Type
shaka.media.ISegmentIndexSource

process(mpdnon-null, networkCallback) → (non-null) {shaka.media.ManifestInfo}

Processes the given MPD. This function modifies |mpd| but does not take ownership of it.
Parameters:
Name Type Description
mpd shaka.dash.mpd.Mpd
networkCallback shaka.util.FailoverUri.NetworkCallback
Source:
Returns:
Type
shaka.media.ManifestInfo

(private) updateCommonDrmInfos_(drmInfosnon-null, commonDrmInfosnon-null)

Sets |commonDrmInfos| to |drmInfos| if |commonDrmInfos| is empty; otherwise, sets |commonDrmInfos| to the intersection between |commonDrmInfos| and |drmInfos|.
Parameters:
Name Type Description
drmInfos Array.<!shaka.player.DrmInfo>
commonDrmInfos Array.<!shaka.player.DrmInfo>
Source:

(private) validateSegmentInfo_(mpdnon-null)

Ensures that each Representation has either a SegmentBase, SegmentList, or SegmentTemplate.
Parameters:
Name Type Description
mpd shaka.dash.mpd.Mpd
Source:

(private) validateSegmentTemplate_(segmentTemplatenon-null) → {boolean}

Ensures that |segmentTemplate| has either an index URL template, a SegmentTimeline, or a segment duration.
Parameters:
Name Type Description
segmentTemplate shaka.dash.mpd.SegmentTemplate
Source:
Returns:
Type
boolean