The MediaPlayer is the primary dash.js Module and a Facade to build your player around.
It will allow you access to all the important dash.js properties/methods via the public API and all the
events to build a robust DASH media player.

Members

(inner, constant) ELEMENT_NOT_ATTACHED_ERROR :string

error string thrown when a function is called before the dash.js has received a reference of an HTML5 video element

Type:
  • string

(inner, constant) MEDIA_PLAYER_NOT_INITIALIZED_ERROR :string

error string thrown when a function is called before the dash.js has been fully initialized.

Type:
  • string

(inner, constant) PLAYBACK_NOT_INITIALIZED_ERROR :string

error string thrown when a function is called before the dash.js has been fully initialized

Type:
  • string

(inner, constant) SOURCE_NOT_ATTACHED_ERROR :string

error string thrown when a function is called before the dash.js has received a valid source stream.

Type:
  • string

(inner, constant) STREAMING_NOT_INITIALIZED_ERROR :string

error string thrown when a function is called before the dash.js has been fully initialized

Type:
  • string

Methods

addABRCustomRule(type, rulename, rule)

Add a custom ABR Rule
Rule will be apply on next stream if a stream is being played

Parameters:
NameTypeDescription
typestring

rule type (one of ['qualitySwitchRules','abandonFragmentRules'])

rulenamestring

name of rule (used to identify custom rule). If one rule of same name has been added, then existing rule will be updated

ruleobject

the rule object instance

Throws:

BAD_ARGUMENT_ERROR if called with invalid arguments.

addUTCTimingSource(schemeIdUri, value)

Allows you to set a scheme and server source for UTC live edge detection for dynamic streams. If UTCTiming is defined in the manifest, it will take precedence over any time source manually added.

If you have exposed the Date header, use the method clearDefaultUTCTimingSources(). This will allow the date header on the manifest to be used instead of a time server

Parameters:
NameTypeDescription
schemeIdUristring
  • urn:mpeg:dash:utc:http-head:2014
  • urn:mpeg:dash:utc:http-xsdate:2014
  • urn:mpeg:dash:utc:http-iso:2014
  • urn:mpeg:dash:utc:direct:2014

Some specs referencing early ISO23009-1 drafts incorrectly use 2012 in the URI, rather than 2014. support these for now.

  • urn:mpeg:dash:utc:http-head:2012
  • urn:mpeg:dash:utc:http-xsdate:2012
  • urn:mpeg:dash:utc:http-iso:2012
  • urn:mpeg:dash:utc:direct:2012
valuestring

Path to a time source.

Default Value
    • schemeIdUri:urn:mpeg:dash:utc:http-xsdate:2014
    • value:http://time.akamai.com/?iso&ms/li>

attachProtectionController(value)

Will override dash.js protection controller.

Parameters:
NameTypeDescription
valueProtectionController

valid protection controller instance.

attachSource(urlOrManifest, startTime)

Use this method to set a source URL to a valid MPD manifest file OR
a previously downloaded and parsed manifest object. Optionally, can
also provide protection information

Parameters:
NameTypeDescription
urlOrManifeststring | Object

A URL to a valid MPD manifest file, or a
parsed manifest object.

startTimenumber | string

For VoD content the start time is relative to the start time of the first period.
For live content
If the parameter starts from prefix posix: it signifies the absolute time range defined in seconds of Coordinated Universal Time (ITU-R TF.460-6). This is the number of seconds since 01-01-1970 00:00:00 UTC. Fractions of seconds may be optionally specified down to the millisecond level.
If no posix prefix is used the starttime is relative to MPD@availabilityStartTime

Throws:

MEDIA_PLAYER_NOT_INITIALIZED_ERROR if called before initialize function

attachTTMLRenderingDiv(div)

Use this method to attach an HTML5 div for dash.js to render rich TTML subtitles.

Parameters:
NameTypeDescription
divHTMLDivElement

An unstyled div placed after the video element. It will be styled to match the video size and overlay z-order.

Throws:

ELEMENT_NOT_ATTACHED_ERROR if called before attachView function

attachView(element)

Use this method to attach an HTML5 VideoElement for dash.js to operate upon.

Parameters:
NameTypeDescription
elementObject

An HTMLMediaElement that has already been defined in the DOM (or equivalent stub).

Throws:

MEDIA_PLAYER_NOT_INITIALIZED_ERROR if called before initialize function

clearDefaultUTCTimingSources()

Allows you to clear the stored array of time sources.

Example use: If you have exposed the Date header, calling this method will allow the date header on the manifest to be used instead of the time server.

Example use: Calling this method, assuming there is not an exposed date header on the manifest, will default back to using a binary search to discover the live edge

convertToTimeCode(value) → {string}

A utility method which converts seconds into TimeCode (i.e. 300 --> 05:00).

Parameters:
NameTypeDescription
valuenumber

A number in seconds to be converted into a formatted time code.

Returns:

A formatted time code string.

Type: 
string

destroy()

Completely destroys the media player and frees all memory.

duration() → {number}

Duration of the media's playback, in seconds.

Throws:

PLAYBACK_NOT_INITIALIZED_ERROR if called before initializePlayback function

Returns:

The current duration of the media. For a dynamic stream this will return DVRWindow.end - DVRWindow.start

Type: 
number

durationAsUTC() → {number}

Use this method to get the current duration as an absolute value, the time in seconds since midnight UTC, Jan 1 1970.
Note - this property only has meaning for live streams.

Throws:

PLAYBACK_NOT_INITIALIZED_ERROR if called before initializePlayback function

Returns:

The current duration as UTC timestamp.

Type: 
number

enableForcedTextStreaming(enable)

Enable/disable text
When enabling dash will keep downloading and process fragmented text tracks even if all tracks are in mode "hidden"

Parameters:
NameTypeDescription
enableboolean

true to enable text streaming even if all text tracks are hidden.

enableText(enable)

Enable/disable text
When enabling text, dash will choose the previous selected text track

Parameters:
NameTypeDescription
enableboolean

true to enable text, false otherwise (same as setTextTrack(-1))

extend(parentNameString, childInstance, override)

This method should be used to extend or replace internal dash.js objects.
There are two ways to extend dash.js (determined by the override argument):

  1. If you set override to true any public method or property in your custom object will override the dash.js parent object's property(ies) and will be used instead but the dash.js parent module will still be created.
  2. If you set override to false your object will completely replace the dash.js object. (Note: This is how it was in 1.x of Dash.js with Dijon).
When you extend you get access to this.context, this.factory and this.parent to operate with in your custom object.
  • this.context - can be used to pass context for singleton access.
  • this.factory - can be used to call factory.getSingletonInstance().
  • this.parent - is the reference of the parent object to call other public methods. (this.parent is excluded if you extend with override set to false or option 2)
You must call extend before you call initialize
Parameters:
NameTypeDescription
parentNameStringstring

name of parent module

childInstanceObject

overriding object

overrideboolean

replace only some methods (true) or the whole object (false)

formatUTC(time, locales, hour12, withDate) → {string}

A utility methods which converts UTC timestamp value into a valid time and date string.

Parameters:
NameTypeDefaultDescription
timenumber

UTC timestamp to be converted into date and time.

localesstring

a region identifier (i.e. en_US).

hour12boolean

12 vs 24 hour. Set to true for 12 hour time formatting.

withDatebooleanfalse

default is false. Set to true to append current date to UTC time format.

Returns:

A formatted time and date string.

Type: 
string

getActiveStream()

This method returns the active stream

Throws:

STREAMING_NOT_INITIALIZED_ERROR if called before initializePlayback function

getAutoPlay() → {boolean}

Returns:

The current autoPlay state.

Type: 
boolean

getAverageThroughput(type) → {number}

Returns the average throughput computed in the ABR logic

Parameters:
NameTypeDescription
typeMediaType
Returns:

value

Type: 
number

getBitrateInfoListFor(type) → {Array}

Parameters:
NameTypeDescription
typeMediaType
Throws:

STREAMING_NOT_INITIALIZED_ERROR if called before initializePlayback function

Returns:
Type: 
Array

getBufferLength(type) → {number}

The length of the buffer for a given media type, in seconds. Valid media
types are "video", "audio" and "text". If no type is passed
in, then the minimum of video, audio and text buffer length is
returned. NaN is returned if an invalid type is requested, the
presentation does not contain that type, or if no arguments are passed
and the presentation does not include any adaption sets of valid media
type.

Parameters:
NameTypeDescription
typeMediaType

'video', 'audio' or 'text'

Returns:

The length of the buffer for the given media type, in
seconds, or NaN

Type: 
number

getCurrentLiveLatency() → {number|NaN}

Throws:

MEDIA_PLAYER_NOT_INITIALIZED_ERROR if called before initialize function

Returns:

Current live stream latency in seconds. It is the difference between now time and time position at the playback head.

Type: 
number | NaN

getCurrentTrackFor(type) → {Object|null}

Parameters:
NameTypeDescription
typeMediaType
Throws:

STREAMING_NOT_INITIALIZED_ERROR if called before initializePlayback function

Returns:

MediaInfo

Type: 
Object | null

getDashAdapter() → {Object}

Returns the DashAdapter.js Module.

Returns:
Type: 
Object

getDashMetrics() → {Object}

Returns the DashMetrics.js Module. You use this Module to get access to all the public metrics
stored in dash.js

Returns:
Type: 
Object

getDebug() → {Debug}

Use this method to access the dash.js logging class.

Returns:
Type: 
Debug

getDVRSeekOffset(value) → {number}

This method should only be used with a live stream that has a valid timeShiftBufferLength (DVR Window).
NOTE - If you do not need the raw offset value (i.e. media analytics, tracking, etc) consider using the seek() method
which will calculate this value for you and set the video element's currentTime property all in one simple call.

Parameters:
NameTypeDescription
valuenumber

A relative time, in seconds, based on the return value of the duration() method is expected.

Returns:

A value that is relative the available range within the timeShiftBufferLength (DVR Window).

Type: 
number

getDVRWindowSize() → {number}

The timeShiftBufferLength (DVR Window), in seconds.

Returns:

The window of allowable play time behind the live point of a live stream as defined in the manifest.

Type: 
number

getInitialMediaSettingsFor(type) → {Object}

This method returns media settings that is used to pick the initial track. Format of the settings
is following:
{lang: langValue,
index: indexValue,
viewpoint: viewpointValue,
audioChannelConfiguration: audioChannelConfigurationValue,
accessibility: accessibilityValue,
role: roleValue}

Parameters:
NameTypeDescription
typeMediaType
Throws:

MEDIA_PLAYER_NOT_INITIALIZED_ERROR if called before initialize function

Returns:
Type: 
Object

getLowLatencyModeEnabled() → {boolean}

Returns a boolean that indicates whether the player is operating in low latency mode.

Returns:
Type: 
boolean

getOfflineController()

Detects if Offline is included and returns an instance of OfflineController.js

getPlaybackRate() → {number}

Returns the current playback rate.

Returns:
Type: 
number

getProtectionController()

Detects if Protection is included and returns an instance of ProtectionController.js

getQualityFor(type) → {number}

Gets the current download quality for media type video, audio or images. For video and audio types the ABR
rules update this value before every new download unless autoSwitchBitrate is set to false. For 'image'
type, thumbnails, there is no ABR algorithm and quality is set manually.

Parameters:
NameTypeDescription
typeMediaType

'video', 'audio' or 'image' (thumbnails)

Throws:

STREAMING_NOT_INITIALIZED_ERROR if called before initializePlayback function

Returns:

the quality index, 0 corresponding to the lowest bitrate

Type: 
number

getSettings() → {PlayerSettings}

Get the current settings object being used on the player.

Returns:

The settings object being used.

Type: 
PlayerSettings

getSource() → {string|manifest}

Returns the source string or manifest that was attached by calling attachSource()

Throws:

SOURCE_NOT_ATTACHED_ERROR if called before attachSource function

Returns:
Type: 
string | manifest

getStreamsFromManifest(manifest) → {Array}

This method returns the list of all available streams from a given manifest

Parameters:
NameTypeDescription
manifestObject
Throws:

STREAMING_NOT_INITIALIZED_ERROR if called before initializePlayback function

Returns:

list of StreamInfo

Type: 
Array

getTargetLiveDelay() → {number}

Returns the target live delay

Returns:

The target live delay

Type: 
number

getTopBitrateInfoFor(type) → {BitrateInfo|null}

Gets the top quality BitrateInfo checking portal limit and max allowed.
It calls getMaxAllowedIndexFor internally

Parameters:
NameTypeDescription
typeMediaType

'video' or 'audio'

Throws:

STREAMING_NOT_INITIALIZED_ERROR if called before initializePlayback function

Returns:
Type: 
BitrateInfo | null

getTracksFor(type) → {Array}

This method returns the list of all available tracks for a given media type

Parameters:
NameTypeDescription
typeMediaType
Throws:

STREAMING_NOT_INITIALIZED_ERROR if called before initializePlayback function

Returns:

list of MediaInfo

Type: 
Array

getTracksForTypeFromManifest(type, manifest, streamInfo) → {Array}

This method returns the list of all available tracks for a given media type and streamInfo from a given manifest

Parameters:
NameTypeDescription
typeMediaType
manifestObject
streamInfoObject
Throws:

STREAMING_NOT_INITIALIZED_ERROR if called before initializePlayback function

Returns:

list of MediaInfo

Type: 
Array

getTTMLRenderingDiv() → {Object}

Returns instance of Div that was attached by calling attachTTMLRenderingDiv()

Returns:
Type: 
Object

getVersion() → {string}

Current version of Dash.js

Returns:

the current dash.js version string.

Type: 
string

getVideoElement() → {Object}

Returns instance of Video Element that was attached by calling attachView()

Throws:

ELEMENT_NOT_ATTACHED_ERROR if called before attachView function

Returns:
Type: 
Object

getVolume() → {number}

Returns the current audio volume, from 0.0 (silent) to 1.0 (loudest).

Returns:
Type: 
number

getXHRWithCredentialsForType(type) → {boolean}

Gets whether withCredentials on XHR requests for a particular request
type is true or false

Parameters:
NameTypeDescription
typestring

one of HTTPRequest.*_TYPE

Returns:
Type: 
boolean

initialize(viewopt, sourceopt, autoPlayopt, startTime)

Upon creating the MediaPlayer you must call initialize before you call anything else.
There is one exception to this rule. It is crucial to call extend()
with all your extensions prior to calling initialize.

ALL arguments are optional and there are individual methods to set each argument later on.
The args in this method are just for convenience and should only be used for a simple player setup.

Parameters:
NameTypeAttributesDescription
viewHTML5MediaElement<optional>

Optional arg to set the video element. attachView()

sourcestring<optional>

Optional arg to set the media source. attachSource()

autoPlayboolean<optional>

Optional arg to set auto play. setAutoPlay()

startTimenumber | string

For VoD content the start time is relative to the start time of the first period.
For live content
If the parameter starts from prefix posix: it signifies the absolute time range defined in seconds of Coordinated Universal Time (ITU-R TF.460-6). This is the number of seconds since 01-01-1970 00:00:00 UTC. Fractions of seconds may be optionally specified down to the millisecond level.
If no posix prefix is used the starttime is relative to MPD@availabilityStartTime

isDynamic() → {boolean}

Returns a Boolean that indicates whether the media is in the process of dynamic.

Throws:

PLAYBACK_NOT_INITIALIZED_ERROR if called before initializePlayback function

Returns:
Type: 
boolean

isMuted() → {boolean}

A Boolean that determines whether audio is muted.

Returns:
Type: 
boolean

isPaused() → {boolean}

Returns a Boolean that indicates whether the Video Element is paused.

Throws:

PLAYBACK_NOT_INITIALIZED_ERROR if called before initializePlayback function

Returns:
Type: 
boolean

isReady() → {boolean}

The ready state of the MediaPlayer based on both the video element and MPD source being defined.

Returns:

The current ready state of the MediaPlayer

Type: 
boolean

isSeeking() → {boolean}

Returns a Boolean that indicates whether the media is in the process of seeking to a new position.

Throws:

PLAYBACK_NOT_INITIALIZED_ERROR if called before initializePlayback function

Returns:
Type: 
boolean

isTextEnabled() → {boolean}

Return if text is enabled

Returns:

return true if text is enabled, false otherwise

Type: 
boolean

off(type, listener, scope)

Use the off method to remove listeners for public events found in MediaPlayer.events. MediaPlayerEvents

Parameters:
NameTypeDescription
typestring

MediaPlayerEvents

listenerfunction

callback method when the event fires.

scopeObject

context of the listener so it can be removed properly.

on(type, listener, scope, options)

Use the on method to listen for public events found in MediaPlayer.events. MediaPlayerEvents

Parameters:
NameTypeDescription
typestring

MediaPlayerEvents

listenerfunction

callback method when the event fires.

scopeObject

context of the listener so it can be removed properly.

optionsObject

object to define various options such as priority and mode

pause()

This method will call pause on the native Video Element.

Throws:

PLAYBACK_NOT_INITIALIZED_ERROR if called before initializePlayback function

play()

The play method initiates playback of the media defined by the attachSource() method.
This method will call play on the native Video Element.

Throws:

PLAYBACK_NOT_INITIALIZED_ERROR if called before initializePlayback function

preload()

Causes the player to begin streaming the media as set by the attachSource()
method in preparation for playing. It specifically does not require a view to be attached with attachView() to begin preloading.
When a view is attached after preloading, the buffered data is transferred to the attached mediaSource buffers.

Throws:

SOURCE_NOT_ATTACHED_ERROR if called before attachSource function

provideThumbnail(time, callback)

Provide the thumbnail at time position. This can be asynchronous, so you must provide a callback ro retrieve thumbnails informations

Parameters:
NameTypeDescription
timenumber

A relative time, in seconds, based on the return value of the duration() method is expected

callbackfunction

A Callback function provided when retrieving thumbnail the given time position. Thumbnail object is null in case there are is not a thumbnails representation or
if it doesn't contain a thumbnail for the given time position.

refreshManifest(callback)

Reload the manifest that the player is currently using.

Parameters:
NameTypeDescription
callbackfunction

A Callback function provided when retrieving manifests

registerCustomCapabilitiesFilter(filter)

Registers a custom capabilities filter. This enables application to filter representations to use.
The provided callback function shall return a boolean based on whether or not to use the representation.
The filters are applied in the order they are registered.

Parameters:
NameTypeDescription
filterfunction

the custom capabilities filter callback

registerLicenseRequestFilter(filter)

Registers a license request filter. This enables application to manipulate/overwrite any request parameter and/or request data.
The provided callback function shall return a promise that shall be resolved once the filter process is completed.
The filters are applied in the order they are registered.

Parameters:
NameTypeDescription
filterfunction

the license request filter callback

registerLicenseResponseFilter(filter)

Registers a license response filter. This enables application to manipulate/overwrite the response data
The provided callback function shall return a promise that shall be resolved once the filter process is completed.
The filters are applied in the order they are registered.

Parameters:
NameTypeDescription
filterfunction

the license response filter callback

removeABRCustomRule(rulename)

Remove a custom ABR Rule

Parameters:
NameTypeDescription
rulenamestring

name of the rule to be removed

removeAllABRCustomRule()

Remove all ABR custom rules

removeUTCTimingSource(schemeIdUri, value)

Allows you to remove a UTC time source. Both schemeIdUri and value need to match the Dash.vo.UTCTiming properties in order for the entry to be removed from the array

Parameters:
NameTypeDescription
schemeIdUristring

see addUTCTimingSource()

valuestring

see addUTCTimingSource()

Throws:

BAD_ARGUMENT_ERROR if called with invalid arguments, schemeIdUri and value are not string type.

reset()

Sets the MPD source and the video element to null. You can also reset the MediaPlayer by
calling attachSource with a new source file.

This call does not destroy the MediaPlayer. To destroy the MediaPlayer and free all of its
memory, call destroy().

resetSettings()

Resets the settings object back to the default.

restoreDefaultUTCTimingSources()

Allows you to restore the default time sources after calling clearDefaultUTCTimingSources()

Default Value
    • schemeIdUri:urn:mpeg:dash:utc:http-xsdate:2014
    • value:http://time.akamai.com/?iso&ms

retrieveManifest(url, callback)

Allows application to retrieve a manifest. Manifest loading is asynchronous and requires the app-provided callback function

Parameters:
NameTypeDescription
urlstring

url the manifest url

callbackfunction

A Callback function provided when retrieving manifests

seek(value)

Sets the currentTime property of the attached video element. If it is a live stream with a
timeShiftBufferLength, then the DVR window offset will be automatically calculated.

Parameters:
NameTypeDescription
valuenumber

A relative time, in seconds, based on the return value of the duration() method is expected.
For dynamic streams duration() returns DVRWindow.end - DVRWindow.start. Consequently, the value provided to this function should be relative to DVRWindow.start.

Throws:

setAutoPlay(value)

Set to false to prevent stream from auto-playing when the view is attached.

Parameters:
NameTypeDescription
valueboolean
Default Value
  • true
Throws:

BAD_ARGUMENT_ERROR if called with an invalid argument, not boolean type.

setConfig(configopt)

Configure media player with customs controllers. Helpful for tests

Parameters:
NameTypeAttributesDescription
configobject<optional>

controllers configuration

setCurrentTrack(track, noSettingsSaveopt)

Parameters:
NameTypeAttributesDefaultDescription
trackMediaInfo

instance of MediaInfo

noSettingsSaveboolean<optional>
false

specify if settings from the track must not be saved for incoming track selection

Throws:

STREAMING_NOT_INITIALIZED_ERROR if called before initializePlayback function

setInitialMediaSettingsFor(type, value)

This method allows to set media settings that will be used to pick the initial track. Format of the settings
is following:

{lang: langValue (can be either a string primitive, a string object, or a RegExp object to match),
index: indexValue,
viewpoint: viewpointValue,
audioChannelConfiguration: audioChannelConfigurationValue,
accessibility: accessibilityValue,
role: roleValue}

Parameters:
NameTypeDescription
typeMediaType
valueObject
Throws:

MEDIA_PLAYER_NOT_INITIALIZED_ERROR if called before initialize function

setMute(value)

Use this method to set the native Video Element's muted state. Takes a Boolean that determines whether audio is muted. true if the audio is muted and false otherwise.

Parameters:
NameTypeDescription
valueboolean
Throws:

BAD_ARGUMENT_ERROR if called with an invalid argument, not boolean type.

setPlaybackRate(value)

Use this method to set the native Video Element's playback rate.

Parameters:
NameTypeDescription
valuenumber

setProtectionData(value)

Sets Protection Data required to setup the Protection Module (DRM). Protection Data must
be set before initializing MediaPlayer or, once initialized, before PROTECTION_CREATED event is fired.

Parameters:
NameTypeDescription
valueProtectionDataSet

object containing
property names corresponding to key system name strings and associated
values being instances of.

setQualityFor(type, value, forceReplace)

Sets the current quality for media type instead of letting the ABR Heuristics automatically selecting it.
This value will be overwritten by the ABR rules unless autoSwitchBitrate is set to false.

Parameters:
NameTypeDefaultDescription
typeMediaType

'video', 'audio' or 'image'

valuenumber

the quality index, 0 corresponding to the lowest bitrate

forceReplacebooleanfalse

true if segments have to be replaced by segments of the new quality

Throws:

STREAMING_NOT_INITIALIZED_ERROR if called before initializePlayback function

setTextTrack(idx)

Use this method to change the current text track for both external time text files and fragmented text tracks. There is no need to
set the track mode on the video object to switch a track when using this method.

Parameters:
NameTypeDescription
idxnumber

Index of track based on the order of the order the tracks are added Use -1 to disable all tracks. (turn captions off). Use module:MediaPlayer#dashjs.MediaPlayer.events.TEXT_TRACK_ADDED.

Throws:

PLAYBACK_NOT_INITIALIZED_ERROR if called before initializePlayback function

setVolume(value)

A double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest).

Parameters:
NameTypeDescription
valuenumber
Throws:

BAD_ARGUMENT_ERROR if called with an invalid argument, not number type, or is NaN or not between 0 and 1.

setXHRWithCredentialsForType(type, value)

Sets whether withCredentials on XHR requests for a particular request
type is true or false

Parameters:
NameTypeDescription
typestring

one of HTTPRequest.*_TYPE

valueboolean
Default Value
  • false

time(streamId) → {number}

Current time of the playhead, in seconds.

If called with no arguments then the returned time value is time elapsed since the start point of the first stream, or if it is a live stream, then the time will be based on the return value of the duration() method.
However if a stream ID is supplied then time is relative to the start of that stream, or is null if there is no such stream id in the manifest.

Parameters:
NameTypeDescription
streamIdstring

The ID of a stream that the returned playhead time must be relative to the start of. If undefined, then playhead time is relative to the first stream.

Throws:

PLAYBACK_NOT_INITIALIZED_ERROR if called before initializePlayback function

Returns:

The current playhead time of the media, or null.

Type: 
number

timeAsUTC() → {number}

Use this method to get the current playhead time as an absolute value, the time in seconds since midnight UTC, Jan 1 1970.
Note - this property only has meaning for live streams. If called before play() has begun, it will return a value of NaN.

Throws:

PLAYBACK_NOT_INITIALIZED_ERROR if called before initializePlayback function

Returns:

The current playhead time as UTC timestamp.

Type: 
number

unregisterCustomCapabilitiesFilter(filter)

Unregisters a custom capabilities filter.

Parameters:
NameTypeDescription
filterfunction

the custom capabilities filter callback

unregisterLicenseRequestFilter(filter)

Unregisters a license request filter.

Parameters:
NameTypeDescription
filterfunction

the license request filter callback

unregisterLicenseResponseFilter(filter)

Unregisters a license response filter.

Parameters:
NameTypeDescription
filterfunction

the license response filter callback

updatePortalSize()

Update the video element size variables
Should be called on window resize (or any other time player is resized). Fullscreen does trigger a window resize event.

Once windowResizeEventCalled = true, abrController.checkPortalSize() will use element size variables rather than querying clientWidth every time.

updateSettings(settingsObj)

Update the current settings object being used on the player. Anything left unspecified is not modified.

This function does not update the entire object, only properties in the passed in object are updated.

This means that updateSettings({a: x}) and updateSettings({b: y}) are functionally equivalent to
updateSettings({a: x, b: y}). If the default values are required again, @seeresetSettings.

Parameters:
NameTypeDescription
settingsObjPlayerSettings

An object corresponding to the settings definition.

Example
player.updateSettings({
     streaming: {
         lowLatencyEnabled: false,
         abr: {
             maxBitrate: { audio: 100, video: 1000 }
         }
     }
 });