Skip to main content

Player Events

CONFIGURED​

The CONFIGURED event is fired when all of the async tasks on setConfig has completed.

Example Event Payload
{
name: config.name,
type: "CONFIGURED",
data: null
}

CLEARED​

Fired when the player is cleared.

Example Event Payload
{ name: config.name, type: "CLEARED", 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.

Example Event Payload
{
name: config.name,
type: "CAN_PLAY",
data: null
}

DURATION_CHANGE​

The DURATION_CHANGE event is fired when the duration attribute has been updated.

ValueDescription
duration FloatNumber representing the duration of the video.
Example Event Payload
{
name: config.name,
type: "DURATION_CHANGE",
data: {
duration: 123
}
}

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.

Example Event Payload
{
name: config.name,
type: "ENDED",
data: null
}

LOADED_MEDIA_INFO​

The LOADED_MEDIA_INFO event is fired when the metadata has been loaded.

Example Event Payload
{
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

Example Event Payload
{
name: config.name,
type: "PAUSED",
data: null
}

PLAYING​

The PLAYING event is fired when the paused property is changed from true to false.

Example Event Payload
{
name: config.name,
type: "PLAYING",
data: null
}

BUFFER_CHANGED​

The BUFFER_CHANGED event is fired periodically as the LuraPlayer loads a resource.

ValueDescription
start FloatNumber representing the start of the buffer in seconds.
end FloatNumber representing the end of the buffer in seconds.
Example Event Payload
{
name: config.name,
type: "BUFFER_CHANGED",
data: {
start: 0.0,
end: 40.0
}
}

BUFFERING_STARTED​

The BUFFERING_STARTED event is fired when the LuraPlayer stopped playing temporarily due to lack of buffer.

Example Event Payload
{
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.

Example Event Payload
{
name: config.name,
type: "BUFFERING_ENDED",
data: null
}

RATE_CHANGE​

The RATE_CHANGE event is fired when the playback rate has changed.

ValueDescription
playbackRate FloatNumber representing the playback rate of the video compared to the original speed of the video.
Example Event Payload
{
name: config.name,
type: "RATE_CHANGE",
data: {
playbackRate: 1.0
}
}

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.

Example Event Payload
{
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.

Example Event Payload
{
name: config.name,
type: "SEEKED",
data: null
}

VOLUME_CHANGED​

The VOLUME_CHANGED event is fired when the volume has changed.

ValueDescription
volume FloatNumber representing the volume percentage of the video in between 0.0 and 1.0.
Example Event Payload
{
name: config.name,
type: "VOLUME_CHANGED",
data: {
volume: 1.0
}
}

MUTE_CHANGED​

The MUTE_CHANGED event is fired when the muted attribute has changed.

ValueDescription
muted BooleanBoolean value representing whether the video is muted or not.
Example Event Payload
{
name: config.name,
type: "MUTE_CHANGED",
data: {
muted: true
}
}

TIME_UPDATED​

The TIME_UPDATED event is fired when the time indicated by the currentTime attribute has been updated.

ValueDescription
contentTime DoubleNumber representing current time without ads.
type "ad" | "content" | "slate"Type of the currently playing video.
ad Object | nullNot null if the type is ad, contains ad information
ad.id StringAd break id.
ad.totalAds IntegerTotal number of ads in the ad break.
ad.adPosition IntegerNumber representing which ad is playing in the ad break.
ad.breakDuration DoubleNumber representing duration of the ad break.
ad.adDuration DoubleNumber representing duration of the current ad.
ad.timeInAd DoubleNumber representing the current time in the ad.
ad.timeInBreak DoubleNumber representing the current time in the ad break.
ad.isClickable BooleanIs Ad has ClickThrough url.
annotations Object[]Active annotations in the time frame
annotations.start DoubleActive annotation start time
annotations.end DoubleActive annotation end time
annotations.type StringType of the active annotataion.
Example Event Payload
{
name: config.name,
type: "TIME_UPDATED",
data: {
contentTime: 15,
type: "ad",
ad: {
id: "ad-break-id",
totalAds: 3,
adPosition: 2,
breakDuration: 90,
adDuration: 30,
timeInAd: 15,
timeInBreak: 45,
isClickable: false
},
annotations: [
{
start: 0.0,
end: 25.0,
type: "intro"
}
]
}
}

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.

ValueDescription
time FloatNumber indicating the time of the trick play image.
width FloatNumber indicating the width of the trick play image.
imageData StringBase64 encoded string that can be set to img src to display.
Example Event Payload
{
name: config.name,
type: "TRICK_PLAY_DATA_EVENT",
data: {
time: 15.0,
width: 640,
imageData: "..."
}
}

TRACK_CHANGED​

The TRACK_CHANGED event is fired when the audio, video or caption track has changed.

ValueDescription
trackType "caption" | "video" | "audio"Type of the track that is changed.
track lura.unified.VideoTrack | lura.unified.AudioTrack | lura.unified.CaptionTrackTrack that have changed.
Example Event Payload
{
name: config.name,
type: "TRACK_CHANGED",
data: {
trackType: "caption",
track: {
language: "en",
label: "English",
active: true
}
}
}

TRACKS_UPDATED​

The TRACKS_UPDATED event is fired when the audio, video or caption tracks has been updated.

Example Event Payload
{
name: config.name,
type: "TRACKS_UPDATED",
data: null
}

SHOW_CAPTION​

The SHOW_CAPTION event is fired for displaying captions in a custom UI implementation.

ValueDescription
text StringCaption Text that should be displayed
Example Event Payload
{
name: config.name,
type: "SHOW_CAPTION",
data: {
text: "Lorem ipsum dolor sit amet."
}
}

CAPTION_DISPLAY_CHANGED​

The CAPTION_DISPLAY_CHANGED event is fired when a caption track is activated or deactivated.

Example Event Payload
{
name: config.name,
type: "CAPTION_DISPLAY_CHANGED",
data: null
}

EVENT_METADATA_UPDATED​

The EVENT_METADATA_UPDATED event is fired when the metadata is updated. (e.g. Live event boundaries)

ValueDescription
title StringTitle of the event (initially configured title if there are no scheduled events).
description StringDescription of the event (initially configured description if there are no scheduled events).
startTime FloatStart time of the event
endTime FloatEnd time of the event
customMetadata Object<[key: string]: string>Custom metadata of the event
Example Event Payload
{
name: config.name,
type: "EVENT_METADATA_UPDATED",
data: {
metadata: {
title: "Lorem Ipsum",
description: "description",
startTime: 158,
endTime: 258,
customMetadata: {
[key: string]: string
}
}
}
}

ENGAGEMENT_LOADED​

Fired when engagement data is loaded.

Example Event Payload
{
name: config.name,
type: "ENGAGEMENT_LOADED",
data: {
id: "engagement-id",
count: 42,
histogram: [0, 3, 5]
}
}

REPLAY​

Event fired when the video replays

Example Event Payload
{
name: config.name,
type: "REPLAY",
data: null
}

ERROR​

Event fired when the LuraPlayer encounters an error that leads to playback failure.

ValueDescription
errorCode IntegerCode representing why the error is fired.
message StringHuman-readable error message.
exception LuraExceptionAndroid only. Nested exception details.
Example Event Payload
{
name: config.name,
type: "ERROR",
data: {
errorCode: 1101,
message: "Failed to fetch"
}
}

WARNING​

Event fired when the LuraPlayer encounters an error which doesn't affect playback and is not critical (e.g. ad request fails due to ad blockers).

ValueDescription
errorCode IntegerInteger code representing why the error is fired.
message StringString representing possible information about the error.
Example Event Payload
{
name: config.name,
type: "WARNING",
data: {
errorCode: 1901,
message: "Too many people are using your account at the moment. There are 1 sessions already active. (1901)"
}
}

TIMED_METADATA​

Triggers after metadata associated with the stream is found

Example Event Payload
{
name: config.name,
type: "TIMED_METADATA",
data: {
[key: string]: string
}
}

DASH_TIMED_METADATA​

Fired when a media timeline region is added

Example Event Payload
{
name: config.name,
type: "DASH_TIMED_METADATA",
data: {
event: string,
detail: {
schemeIdUri: string,
eventElement: Element,
startTime: number
}
}
}

CUSTOM_DATA_CHANGED​

Fired when the custom data is changed by setCustomData method.

Example Event Payload
{
name: config.name,
type: "CUSTOM_DATA_CHANGED",
data: {
key: string,
value?: any
}
}

EVENT_NOTIFIED​

Fired when an event is notified through notifyEvent(eventType, payload).

For CLICK and BACK_CLICK, data contains type and payload. For CTA_CLICK, data contains the selected call-to-action item fields.

ValueDescription
type StringNotified event type. Present for CLICK and BACK_CLICK.
payload AnyPayload passed to notifyEvent. Present for CLICK and BACK_CLICK.
id StringCall-to-action item id. Present for CTA_CLICK.
label StringCall-to-action button label. Present for CTA_CLICK.
buttonVariant IntegerCustom call-to-action button variant. Present for CTA_CLICK.
action IntegerCall-to-action item action. Present for CTA_CLICK.
data StringCall-to-action item action data. Present for CTA_CLICK.
start DoubleCall-to-action item start time in seconds. Present for CTA_CLICK.
end DoubleCall-to-action item end time in seconds. Present for CTA_CLICK.
Example Event Payload
{
name: config.name,
type: "EVENT_NOTIFIED",
data: {
type: "BACK_CLICK",
payload: {
source: "back-button"
}
}
}

INTERSTITIALS​

Event fired when the player has retrieved a new ad information.

Example Event Payload
{
name: config.name,
type: "INTERSTITIALS",
data: null
}

AD_IMPRESSION​

Event fired when an ad is displayed in the video player

Example Event Payload
{
name: config.name,
type: "AD_IMPRESSION",
data: null
}

AD_BREAK_STARTED​

Event fired when an ad break begins to play in the video player

Check out lura.unified.AdBreak

Example Event Payload
{
name: config.name,
type: "AD_BREAK_STARTED",
data: lura.unified.AdBreak
}

AD_STARTED​

Event fired when an individual ad begins to play in the video player

Check out lura.unified.Ad

Example Event Payload
{
name: config.name,
type: "AD_STARTED",
data: lura.unified.Ad
}

AD_FIRST_QUARTILE​

Event fired when an ad has reached the first quarter of its duration

Example Event Payload
{
name: config.name,
type: "AD_FIRST_QUARTILE",
data: null
}

AD_MIDPOINT​

Event fired when an ad has reached its midpoint

Example Event Payload
{
name: config.name,
type: "AD_MIDPOINT",
data: null
}

AD_THIRD_QUARTILE​

Event fired when an ad has reached the third quarter of its duration

Example Event Payload
{
name: config.name,
type: "AD_THIRD_QUARTILE",
data: null
}

AD_COMPLETED​

Event fired when an individual ad has completed playing in the video player

Example Event Payload
{
name: config.name,
type: "AD_COMPLETED",
data: null
}

AD_BREAK_COMPLETED​

Event fired when an ad break is completed

Example Event Payload
{
name: config.name,
type: "AD_BREAK_COMPLETED",
data: null
}

AD_CLICKED​

Event fired when the user clicks on an ad in the video player

Example Event Payload
{
name: config.name,
type: "AD_CLICKED",
data: null
}

AD_SKIPPED​

Event fired when an ad is skipped by the user

Example Event Payload
{
name: config.name,
type: "AD_SKIPPED",
data: null
}

CASTING_REQUESTED​

Event fired when casting is requested in the video player

Example Event Payload
{
name: config.name,
type: "CASTING_REQUESTED",
data: null
}

CASTING_STARTED​

Event fired when casting is started in the video player

Example Event Payload
{
name: config.name,
type: "CASTING_STARTED",
data: null
}

CASTING_ENDED​

Event fired when casting is ended in the video player

Example Event Payload
{
name: config.name,
type: "CASTING_ENDED",
data: null
}

CAST_AVAILABILITY_CHANGED​

Event fired when cast availability is changed in the video player.

Example Event Payload
{
name: config.name,
type: "CAST_AVAILABILITY_CHANGED",
data: null
}

LIVE_AVAILABILITY_WINDOW_FOUND​

Event fired when the availability window of the live stream is found or changed.

Example Event Payload
{
name: config.name,
type: "LIVE_AVAILABILITY_WINDOW_FOUND",
data: {
id: "123",
start: 1720007466.0,
end: 1720008466.0,
}
}

LATENCY_MODE_CHANGED​

Fired when the latency mode changes.

ValueDescription
latencyMode StringCurrent effective latency mode.
availability ObjectAvailability map for supported latency modes.
availability.def BooleanWhether default latency mode is available.
availability.low BooleanWhether low-latency mode is available.

Check out lura.unified.LatencyModes

Example Event Payload
{
name: config.name,
type: "LATENCY_MODE_CHANGED",
data: {
latencyMode: "low",
availability: {
def: true,
low: true
}
}
}

SCREEN_STATE_CHANGED​

Event fired when the screen state changed.

Example Event Payload
{
name: config.name,
type: "SCREEN_STATE_CHANGED",
data: {
state: "WINDOWED",
}
}

PLAYLIST_ITEM_LOADED​

Fired when a playlist item is loaded.

Example Event Payload
{
name: config.name,
type: "PLAYLIST_ITEM_LOADED",
data: {
item: lura.unified.Configuration,
index: number
}
}

PLAYLIST_ITEM_CHANGED​

Fired when a playlist item is modified, added or removed.

Example Event Payload
{
name: config.name,
type: "PLAYLIST_ITEM_CHANGED",
data: {
item: lura.unified.Configuration,
index: number
}
}

PLAYLIST_COMPLETED​

Fired when the playlist has no more configuration left to play and the repeat mode is set to false.

Example Event Payload
{
name: config.name,
type: "PLAYLIST_COMPLETED",
data: {
item: lura.unified.Configuration,
index: number
}
}

PLAYLIST_CONFIG_CHANGE_NEEDED​

Fired when a configuration change is needed. This will be fired when the token is about to expire.

Example Event Payload
{
name: config.name,
type: "PLAYLIST_CONFIG_CHANGE_NEEDED",
data: {
item: lura.unified.Configuration,
index: number
}
}

PLAYLIST_INITIALIZED​

Fired when the playlist is initialized with a new setConfig method call.

Example Event Payload
{
name: config.name,
type: "PLAYLIST_INITIALIZED",
data: null
}

PLAYLIST_DISCARDED​

Fired when the playlist has been discarded with a new setConfig method call.

Example Event Payload
{
name: config.name,
type: "PLAYLIST_DISCARDED",
data: null
}

PLAYLIST_AUTO_SWITCH_COUNTER​

Fired when the auto switch mechanism is active and counter started.

Example Event Payload
{
name: config.name,
type: "PLAYLIST_AUTO_SWITCH_COUNTER",
data: {
item: lura.unified.Configuration,
index: number,
remaining: number,
}
}

PLAYLIST_AUTO_SWITCH_ABORTED​

Fired when the auto switch mechanism is aborted by abortPlaylistAutoSwitch method.

Example Event Payload
{
name: config.name,
type: "PLAYLIST_AUTO_SWITCH_ABORTED",
data: null
}

HIGHLIGHTS_UPDATED​

Fired when the available highlights are updated.

Example Event Payload
{ name: config.name, type: "HIGHLIGHTS_UPDATED", data: null }

HIGHLIGHT_LOADED​

Fired when a highlight is loaded.

ValueDescription
id StringHighlight id.
active BooleanWhether the highlight is currently active.
time DoubleHighlight start time in seconds.
description StringHighlight description.
title StringHighlight title.
poster StringHighlight poster image URL.
Example Event Payload
{
name: config.name,
type: "HIGHLIGHT_LOADED",
data: {
id: "highlight-id",
active: true,
time: 120,
description: "Highlight description",
title: "Highlight title",
poster: "https://example.com/poster.jpg"
}
}

HIGHLIGHT_UNLOADED​

Fired when a highlight is unloaded.

Example Event Payload
{ name: config.name, type: "HIGHLIGHT_UNLOADED", data: null }

HIGHLIGHT_AUTO_SWITCH_COUNTER​

Fired while the highlight auto-switch countdown is running.

ValueDescription
remaining IntegerRemaining auto-switch countdown time in seconds.
Example Event Payload
{ name: config.name, type: "HIGHLIGHT_AUTO_SWITCH_COUNTER", data: { remaining: 5 } }

HIGHLIGHT_AUTO_SWITCH_ABORTED​

Fired when the highlight auto-switch countdown is aborted.

Example Event Payload
{ name: config.name, type: "HIGHLIGHT_AUTO_SWITCH_ABORTED", data: null }

NON_LINEAR_MARKERS​

Fired when non-linear ad markers are available.

Example Event Payload
{
name: config.name,
type: "NON_LINEAR_MARKERS",
data: {
markers: [
{
id: "marker-id",
type: "non_linear",
duration: 15,
offset: 120,
assetId: "asset-id",
url: "https://example.com/non-linear.json"
}
]
}
}

NON_LINEAR_STARTED​

Fired when non-linear ad playback starts.

Example Event Payload
{ name: config.name, type: "NON_LINEAR_STARTED", data: { adId: "ad-id" } }

NON_LINEAR_COMPLETED​

Fired when non-linear ad playback completes.

Example Event Payload
{ name: config.name, type: "NON_LINEAR_COMPLETED", data: { adId: "ad-id" } }

NON_LINEAR_PROGRESS​

Fired when non-linear ad progress changes.

Example Event Payload
{
name: config.name,
type: "NON_LINEAR_PROGRESS",
data: {
adId: "ad-id",
duration: 15,
time: 5
}
}

NON_LINEAR_LOADED​

Fired when a non-linear ad is loaded.

Example Event Payload
{
name: config.name,
type: "NON_LINEAR_LOADED",
data: {
adId: "ad-id",
ad: {
id: "ad-id",
type: "non_linear",
tracking: [],
adSystem: "Lura",
clickThroughUrl: "https://example.com",
creativeId: "creative-id",
verification: [],
composition: {
viewport: { width: 1920, height: 1080 },
duration: 15,
timescale: 1,
layers: []
}
}
}
}