Player Events Reference
CONFIGURED
The CONFIGURED event is fired when all of the async tasks on setConfig has completed.
{
name: config.name,
type: "CONFIGURED",
data: null
}
CAN_PLAY
The CAN_PLAY event is fired when the user agent can start playing the media. Everytime buffering ends and player is able to play, this event is fired.
{
name: config.name,
type: "CAN_PLAY",
data: null
}
DURATION_CHANGE
The DURATION_CHANGE event is fired when the duration attribute has been updated.
{
name: config.name,
type: "DURATION_CHANGE",
data: {
duration: 123 // Number
}
}
ENDED
The ENDED event is fired when playback or streaming has stopped because the end of the media was reached or because no further data is available.
{
name: config.name,
type: "ENDED",
data: null
}
LOADED_MEDIA_INFO
The LOADED_MEDIA_INFO event is fired when the metadata has been loaded.
{
name: config.name,
type: "LOADED_MEDIA_INFO",
data: null
}
PAUSED
The PAUSED event is fired when the paused property is changed from false to true
{
name: config.name,
type: "PAUSED",
data: null
}
PLAYING
The PLAYING event is fired when the paused property is changed from true to false.
{
name: config.name,
type: "PLAYING",
data: null
}
BUFFER_CHANGED
The BUFFER_CHANGED event is fired periodically as the LuraPlayer loads a resource.
{
name: config.name,
type: "BUFFER_CHANGED",
data: {
start: 0.0 // In seconds
end: 40.0 // In seconds
}
}
BUFFERING_STARTED
The BUFFERING_STARTED event is fired when the LuraPlayer stopped playing temporarily due to lack of buffer.
{
name: config.name,
type: "BUFFERING_STARTED",
data: null
}
BUFFERING_ENDED
The BUFFERING_ENDED event is fired when the LuraPlayer starts playing after stopping temporarily due to lack of buffer.
{
name: config.name,
type: "BUFFERING_ENDED",
data: null
}
RATE_CHANGE
The RATE_CHANGE event is fired when the playback rate has changed.
{
name: config.name,
type: "RATE_CHANGE",
data: {
playbackRate: 1.0 // Number
}
}
SEEKING
The SEEKING event is fired when a seek operation starts, meaning the Boolean seeking attribute has changed to true and the media is seeking a new position.
{
name: config.name,
type: "SEEKING",
data: null
}
SEEKED
The SEEKED event is fired when a seek operation finishes, meaning the Boolean seeking attribute has changed to false and the media is seeked to a new position.
{
name: config.name,
type: "SEEKED",
data: {
playbackRate: 1.0 // Number
}
}
VOLUME_CHANGED
The VOLUME_CHANGED event is fired when the volume has changed.
{
name: config.name,
type: "VOLUME_CHANGED",
data: {
volume: 1.0 // Number between 0 and 1
}
}
MUTE_CHANGED
The MUTE_CHANGED event is fired when the muted attribute has changed.
{
name: config.name,
type: "MUTE_CHANGED",
data: {
muted: true // Boolean
}
}
MUTED_AUTOPLAY_FORCED
The MUTED_AUTOPLAY_FORCED event is fired when the autoplay attribute is set to true, but the device doesn't allow
{
name: config.name,
type: "MUTED_AUTOPLAY_FORCED",
data: null
}
unmuted autoplay.
TIME_UPDATED
The TIME_UPDATED event is fired when the time indicated by the currentTime attribute has been updated.
{
name: config.name,
type: "TIME_UPDATED",
data: {
contentTime: 15, // Number representing current time without ads.
stitchedTime: 30, // Number representing current time with ads.
type: "ad", // or "content" or "slate"
ad: { // null if type is not "ad"
id: "ad-break-id", // string
totalAds: 3, // Total number of ads in the ad break
adPosition: 2, // Number representing which ad is playing in the ad break
breakDuration: 90, // Number representing duration of the ad break
adDuration: 30, // Number representing duration of the current ad
timeInAd: 15, // Number representing the current time in the ad
timeInBreak: 45 // Number representing the current time in the ad break
}
}
}
TRICK_PLAY_DATA_EVENT
The TRICK_PLAY_DATA_EVENT event is fired as a response to the trick play data requested for a specific time.
{
name: config.name,
type: "TRICK_PLAY_DATA_EVENT",
data: {
time: 15.0, // Number indicating the time of the trick play image
width: 640, // Number indicating the width of the trick play image
imageData: "..." // Base64 encoded string that can be set to img src to display
}
}
TRACK_CHANGED
The TRACK_CHANGED event is fired when the audio, video or caption track has changed.
{
name: config.name,
type: "TRACK_CHANGED",
data: {
trackType: "caption", // or "video" or "audio"
track: { // caption track, video track or audio track based on track type
language: "en",
label: "English",
type: "subtitle",
active: true
}
}
}
EVENT_METADATA_UPDATED
The EVENT_METADATA_UPDATED event is fired when the metadata is updated. (e.g. Live event boundaries)
{
name: config.name,
type: "EVENT_METADATA_UPDATED",
data: {
metadata: { // Event metadata
title: "Lorem Ipsum",
description: "description",
startTime: 158,
endTime: 258,
}
}
}
REPLAY
Event fired when the video replays
{
name: config.name,
type: "REPLAY",
data: null
}
ERROR
Event fired when the LuraPlayer encounters an error.
{
name: config.name,
type: "ERROR",
data: {
errorCode: "NETWORK_ERROR", // String representing why the error is fired
message: "Failed to fetch" // String representing possible information about the error
}
}
CASTING_REQUESTED
Event fired when casting is requested in the video player
{
name: config.name,
type: "CASTING_REQUESTED",
data: null
}
CASTING_STARTED
Event fired when casting is started in the video player
{
name: config.name,
type: "CASTING_STARTED",
data: null
}
CASTING_ENDED
Event fired when casting is ended in the video player
{
name: config.name,
type: "CASTING_ENDED",
data: null
}
AD_IMPRESSION
Event fired when an ad is displayed in the video player
{
name: config.name,
type: "AD_IMPRESSION",
data: null
}
AD_BREAK_STARTED
Event fired when an ad break begins to play in the video player
{
name: config.name,
type: "AD_BREAK_STARTED",
data: null
}
AD_STARTED
Event fired when an individual ad begins to play in the video player
{
name: config.name,
type: "AD_STARTED",
data: null
}
AD_FIRST_QUARTILE
Event fired when an ad has reached the first quarter of its duration
{
name: config.name,
type: "AD_FIRST_QUARTILE",
data: null
}
AD_MIDPOINT
Event fired when an ad has reached its midpoint
{
name: config.name,
type: "AD_MIDPOINT",
data: null
}
AD_THIRD_QUARTILE
Event fired when an ad has reached the third quarter of its duration
{
name: config.name,
type: "AD_THIRD_QUARTILE",
data: null
}
AD_COMPLETED
Event fired when an individual ad has completed playing in the video player
{
name: config.name,
type: "AD_COMPLETED",
data: null
}
AD_BREAK_COMPLETED
Event fired when an ad break is completed
{
name: config.name,
type: "AD_BREAK_COMPLETED",
data: null
}
AD_PAUSED
Event fired when an ad is paused by the user or programmatically
{
name: config.name,
type: "AD_PAUSED",
data: null
}
AD_RESUMED
Event fired when an ad is resumed by the user or programmatically
{
name: config.name,
type: "AD_RESUMED",
data: null
}
AD_CLICKED
Event fired when the user clicks on an ad in the video player
{
name: config.name,
type: "AD_CLICKED",
data: null
}
AD_SKIPPED
Event fired when an ad is skipped by the user
{
name: config.name,
type: "AD_SKIPPED",
data: null
}
AD_VOLUME_CHANGED
Event fired when the volume of the player is changed during an ad
{
name: config.name,
type: "AD_VOLUME_CHANGED",
data: null
}
AD_STOPPED
Event fired when the ad is discarded.
{
name: config.name,
type: "AD_STOPPED",
data: null
}
TIMED_METADATA
Triggers after metadata associated with the stream is found
{
name: config.name,
type: "TIMED_METADATA",
data: {
[key: string]: string
}
}
DASH_TIMED_METADATA
Fired when a media timeline region is added
{
name: config.name,
type: "DASH_TIMED_METADATA",
data: {
event: string,
detail: {
schemeIdUri: string,
eventElement: Element,
startTime: number
}
}
}