Parses media manifests and handles manifest updates.
Given a URI where the initial manifest is found, a parser will request the
manifest, parse it, and return the resulting Manifest object.
If the manifest requires updates (e.g. for live media), the parser will use
background timers to update the same Manifest object.
- Implementations:
- Source:
Methods
-
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
shakaExtern.ManifestConfiguration -
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 -
start(uri, playerInterface) → (non-null) {Promise.<shakaExtern.Manifest>}
-
Parses the given manifest data into a Manifest object and starts any background timers that are needed. This will only be called once.
Parameters:
Name Type Description uri
string The URI of the manifest. playerInterface
shakaExtern.ManifestParser.PlayerInterface Contains the interface to the Player. - Implementations:
- Source:
Returns:
- Type
- Promise.<shakaExtern.Manifest>
-
stop() → (non-null) {Promise}
-
Stops any background timers and frees any objects held by this instance. This will only be called after a successful call to start. This will only be called once.
- Implementations:
- Source:
Returns:
- Type
- Promise
-
update()
-
Tells the parser to do a manual manifest update. Implementing this is optional and is only called when 'emsg' boxes are present.
Type Definitions
-
Factory
-
A factory for creating the manifest parser. This will be called with 'new'. This function is registered with shaka.media.ManifestParser to create parser instances.
Type:
- function(new:shakaExtern.ManifestParser)
- Source:
-
PlayerInterface
-
Defines the interface of the Player to the manifest parser. This defines fields and callback methods that the parser will use to interact with the Player. The callback methods do not to be called as member functions (i.e. they can be called as "free" functions).
Type:
- {networkingEngine: !shaka.net.NetworkingEngine, filterPeriod: function(shakaExtern.Period), onTimelineRegionAdded: function(shakaExtern.TimelineRegionInfo), onEvent: function(!Event), onError: function(!shaka.util.Error)}
Properties:
Name Type Description networkingEngine
shaka.net.NetworkingEngine The networking engine to use for network requests. filterPeriod
function(shakaExtern.Period) Should be called on all new Periods so that they can be filtered. onTimelineRegionAdded
function(shakaExtern.TimelineRegionInfo) Should be called when a new timeline region is added. onEvent
function(!Event) Should be called to raise events. onError
function(!shaka.util.Error) Should be called when an error occurs. - Source: