Classes

Classes

MediaPlayer

Events


bufferLevel_updated

The bufferLevel_updated event is fired when the buffer level changed.
Parameters:
Name Type Description
event CustomEvent the event
Properties
Name Type Description
detail object the event data
Properties
Name Type Description
type string the stream type ('audio' or 'video')
level number the buffer level (in seconds)

cueEnter

The cueEnter event is fired when a subtitle cue needs to be displayed.
Parameters:
Name Type Description
event object the event
Properties
Name Type Description
type object the event type ('cueEnter')
data object the event data
Properties
Name Type Description
text object the subtitle text
style.backgroundColor string the background color
style.color string the font color
style.fontFamily string the font family
style.fontSize string the font size

cueExit

The cueExit event is fired when a subtitle cue needs to be erased.
Parameters:
Name Type Description
event object the event
Properties
Name Type Description
type object the event type ('cueExit')
data object the event data
Properties
Name Type Description
text object the subtitle text
style.backgroundColor string the background color
style.color string the font color
style.fontFamily string the font family
style.fontSize string the font size

download_bitrate

The download_bitrate event is fired when the current downloaded bitrate has changed.
Parameters:
Name Type Description
event CustomEvent the event
Properties
Name Type Description
detail object the event data
Properties
Name Type Description
type string the stream type ('audio' or 'video')
bitrate number the new bitrate
representationId string the corresponding representation id (from manifest)
time number the current video time
width number in case of video stream, the video width of the representation
height number in case of video stream, the video height of the representation

error

The error event is fired when an error occurs. When the error event is fired, the application shall stop the player.
Parameters:
Name Type Description
event object the event
Properties
Name Type Description
type object the event type ('error')
data object the event data
Properties
Name Type Description
code string error code
message string error message
data object error additionnal data

manifestUrlUpdate

The manifestUrlUpdate event is fired when the URL of the manifest may have to be refreshed, since the player failed to download the manifest file (URL expiration for example). The application shall therefore provide an updated manifest URL by using the method refreshManifest
Parameters:
Name Type Description
event object the event
Properties
Name Type Description
type object the event type ('manifestUrlUpdate')
data object the event data
Properties
Name Type Description
url object the current manifest url

play_bitrate

The 'play_bitrate' event is fired when the current played bitrate has changed.
Parameters:
Name Type Description
event CustomEvent the event
Properties
Name Type Description
detail object the event data
Properties
Name Type Description
type string the stream type ('audio' or 'video')
bitrate number the new bitrate
representationId string the corresponding representation id (from manifest)
time number the current video time
width number in case of video stream, the video width of the representation
height number in case of video stream, the video height of the representation

state_changed

The state_changed event is fired when the player state changed.
Parameters:
Name Type Description
event CustomEvent the event
Properties
Name Type Description
detail object the event data
Properties
Name Type Description
type string the stream type ('audio' or 'video')
state string the current state ('stopped', 'buffering', 'seeking' or 'playing')

warning

The warning event is fired when a warning occurs.
Parameters:
Name Type Description
event object the event
Properties
Name Type Description
type object the event type ('warning')
data object the event data
Properties
Name Type Description
code string warning code
message string warning message
data object warning additionnal data