Methods
banLocation(uri)
Tells the parser that a location should be banned. This is called on
retry.
Parameters:
Name | Type | Description |
---|---|---|
uri |
string |
- Source:
configure(config, isPreloadFnopt)
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 | Attributes | Description |
---|---|---|---|
config |
shaka.extern.ManifestConfiguration | ||
isPreloadFn |
function |
<optional> |
- Source:
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 |
- Source:
onInitialVariantChosen(variant)
Tells the parser that the initial variant has been chosen.
Parameters:
Name | Type | Description |
---|---|---|
variant |
shaka.extern.Variant |
- Source:
setMediaElement(mediaElement)
Set media element.
Parameters:
Name | Type | Description |
---|---|---|
mediaElement |
HTMLMediaElement |
- 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. |
- 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.
- 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.
- Source:
Type Definitions
Factory
A factory for creating the manifest parser. This function is registered with
shaka.media.ManifestParser to create parser instances.
Type:
- function():!shaka.extern.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 need to be called as member functions
(i.e. they can be called as "free" functions).
Type:
- {networkingEngine: !shaka.net.NetworkingEngine, filter: function(shaka.extern.Manifest): !Promise, makeTextStreamsForClosedCaptions: function(shaka.extern.Manifest), onTimelineRegionAdded: function(shaka.extern.TimelineRegionInfo), onEvent: function(!Event), onError: function(!shaka.util.Error), isLowLatencyMode: function(): boolean, isAutoLowLatencyMode: function(): boolean, enableLowLatencyMode: function(), updateDuration: function(), newDrmInfo: function(shaka.extern.Stream), onManifestUpdated: function(), getBandwidthEstimate: function(): number, onMetadata: function(string, number, ?number, !Array.<shaka.extern.MetadataFrame>), disableStream: function(!shaka.extern.Stream), addFont: function(string, string)}
Properties:
Name | Type | Description |
---|---|---|
networkingEngine |
shaka.net.NetworkingEngine | The networking engine to use for network requests. |
filter |
function | Should be called when new variants or text streams are added to the Manifest. Note that this operation is asynchronous. |
makeTextStreamsForClosedCaptions |
function | A callback that adds text streams to represent the closed captions of the video streams in the Manifest. Should be called whenever new video streams are added to the Manifest. |
onTimelineRegionAdded |
function | Should be called when a new timeline region is added. |
onEvent |
function | Should be called to raise events. |
onError |
function | Should be called when an error occurs. |
isLowLatencyMode |
function | Return true if low latency streaming mode is enabled. |
isAutoLowLatencyMode |
function | Return true if auto low latency streaming mode is enabled. |
enableLowLatencyMode |
function | Enable low latency streaming mode. |
updateDuration |
function | Update the presentation duration based on PresentationTimeline. |
newDrmInfo |
function | Inform the player of new DRM info that needs to be processed for the given stream. |
onManifestUpdated |
function | Should be called when the manifest is updated. |
getBandwidthEstimate |
function | Get the estimated bandwidth in bits per second. |
onMetadata |
function | Called when an metadata is found in the manifest. |
disableStream |
function | Called to temporarily disable a stream i.e. disabling all variant containing said stream. |
addFont |
function | Called when a new font needs to be added. |
- Source: