Class: shaka.mss.MssParser

Constructor

new MssParser()

Creates a new MSS parser.
Implements:
Source:

Members

DEFAULT_TIME_SCALE_ :number

Type:
  • number
Source:

MIN_UPDATE_PERIOD_ :number

Contains the minimum amount of time, in seconds, between manifest update requests.
Type:
  • number
Source:

ROLE_MAPPING_ :Object.<string, string>

MPEG-DASH Role and accessibility mapping for text tracks according to ETSI TS 103 285 v1.1.1 (section 7.1.2)
Type:
  • Object.<string, string>
Source:

SUPPORTED_CODECS_ :Array.<string>

MSS supported codecs.
Type:
  • Array.<string>
Source:

averageUpdateDuration_ :shaka.abr.Ewma

An ewma that tracks how long updates take. This is to mitigate issues caused by slow parsing on embedded devices.
Type:
Source:

globalId_ :number

Type:
  • number
Source:

initSegmentDataByStreamId_ :Map.<number, !BufferSource>

Type:
  • Map.<number, !BufferSource>
Source:

manifestUris_ :Array.<string>

Type:
  • Array.<string>
Source:

updatePeriod_ :number

The update period in seconds, or 0 for no updates.
Type:
  • number
Source:

Methods

banLocation(uri)

Tells the parser that a location should be banned. This is called on retry.
Parameters:
Name Type Description
uri string
Implements:
Source:

configure(config)

Called by the Player to provide an updated configuration any time the configuration changes. Will be called at least once before start().
Parameters:
Name Type Description
config shaka.extern.ManifestConfiguration
Implements:
Source:

createSegments_(initSegmentRefnon-null, streamnon-null, streamIndexnon-null, timelinenon-null) → {Array.<!shaka.media.SegmentReference>}

Parameters:
Name Type Description
initSegmentRef shaka.media.InitSegmentReference
stream shaka.extern.Stream
streamIndex Element
timeline Array.<shaka.mss.MssParser.TimeRange>
Source:
Returns:
Type
Array.<!shaka.media.SegmentReference>

createStream_(streamIndexnon-null, qualityLevelnon-null, timelinenon-null, drmInfosnon-null, contextnon-null) → {shaka.extern.Stream}

Parameters:
Name Type Description
streamIndex Element
qualityLevel Element
timeline Array.<shaka.mss.MssParser.TimeRange>
drmInfos Array.<shaka.extern.DrmInfo>
context shaka.mss.MssParser.Context
Source:
Returns:
Type
shaka.extern.Stream

createTimeline_(streamIndexnon-null, timescale, duration) → {Array.<shaka.mss.MssParser.TimeRange>}

Expands a streamIndex into an array-based timeline. The results are in seconds.
Parameters:
Name Type Description
streamIndex Element
timescale number
duration number The duration in seconds.
Source:
Returns:
Type
Array.<shaka.mss.MssParser.TimeRange>

createVariant_(audioStreamnullable, videoStreamnullable) → {shaka.extern.Variant}

Parameters:
Name Type Attributes Description
audioStream shaka.extern.Stream <nullable>
videoStream shaka.extern.Stream <nullable>
Source:
Returns:
Type
shaka.extern.Variant

getAACCodec_(qualityLevelnon-null, fourCCValue, codecPrivateDatanullable) → {string}

Parameters:
Name Type Attributes Description
qualityLevel Element
fourCCValue string
codecPrivateData string <nullable>
Source:
Returns:
Type
string

getCodecPrivateData_(qualityLevelnon-null, type, fourCCValue, streamnon-null) → {string}

Parameters:
Name Type Description
qualityLevel Element
type string
fourCCValue string
stream shaka.extern.Stream
Source:
Returns:
Type
string

getH264Codec_(qualityLevelnon-null, codecPrivateDatanullable) → {string}

Parameters:
Name Type Attributes Description
qualityLevel Element
codecPrivateData string <nullable>
Source:
Returns:
Type
string

onExpirationUpdated(sessionId, expiration)

Tells the parser that the expiration time of an EME session has changed. Implementing this is optional.
Parameters:
Name Type Description
sessionId string
expiration number
Implements:
Source:

onInitialVariantChosen(variant)

Tells the parser that the initial variant has been chosen.
Parameters:
Name Type Description
variant shaka.extern.Variant
Implements:
Source:

onUpdate_() → {Promise}

Called when the update timer ticks.
Source:
Returns:
Type
Promise

parseManifest_(data, finalManifestUri) → {Promise}

Parses the manifest XML. This also handles updates and will update the stored manifest.
Parameters:
Name Type Description
data BufferSource
finalManifestUri string The final manifest URI, which may differ from this.manifestUri_ if there has been a redirect.
Source:
Returns:
Type
Promise

parseStreamIndexes_(mssnon-null, contextnon-null)

Parameters:
Name Type Description
mss Element
context shaka.mss.MssParser.Context
Source:

processManifest_(mssnon-null, finalManifestUri)

Takes a formatted MSS and converts it into a manifest.
Parameters:
Name Type Description
mss Element
finalManifestUri string The final manifest URI, which may differ from this.manifestUri_ if there has been a redirect.
Source:

requestManifest_()

Makes a network request for the manifest and parses the resulting data.
Source:

setUpdateTimer_()

Sets the update timer. Does nothing if the manifest is not live.
Source:

start(uri, playerInterface) → {Promise.<shaka.extern.Manifest>}

Initialize and start the parser. When |start| resolves, it should return the initial version of the manifest. |start| will only be called once. If |stop| is called while |start| is pending, |start| should reject.
Parameters:
Name Type Description
uri string The URI of the manifest.
playerInterface shaka.extern.ManifestParser.PlayerInterface The player interface contains the callbacks and members that the parser can use to communicate with the player and outside world.
Implements:
Source:
Returns:
Type
Promise.<shaka.extern.Manifest>

stop() → {Promise}

Tell the parser that it must stop and free all internal resources as soon as possible. Only once all internal resources are stopped and freed will the promise resolve. Once stopped a parser will not be started again. The parser should support having |stop| called multiple times and the promise should always resolve.
Implements:
Source:
Returns:
Type
Promise

update()

Tells the parser to do a manual manifest update. Implementing this is optional. This is only called when 'emsg' boxes are present.
Implements:
Source:

Type Definitions

Context

Type:
Properties:
Name Type Description
variants Array.<shaka.extern.Variant> The presentation's Variants.
textStreams Array.<shaka.extern.Stream> The presentation's text streams.
timescale number The presentation's timescale.
duration number The presentation's duration.
Source:

TimeRange

Defines a time range of a media segment. Times are in seconds.
Type:
  • {start: number, unscaledStart: number, end: number}
Properties:
Name Type Description
start number The start time of the range.
unscaledStart number The start time of the range in representation timescale units.
end number The end time (exclusive) of the range.
Source: