Search.../

onEnded( )

Adds an event handler that runs when the playback has ended.

Description

A video ends when the playback reaches the duration of the video.

If the video is set to play in a loop, this event handler is never triggered.

Syntax

function onEnded(handler: EventHandler): VideoBox
handler: function EventHandler(event: Event): void

onEnded Parameters

NAME
TYPE
DESCRIPTION
handler

The name of the function or the function expression to run when the video has ended.

Returns

The video box that triggered the event.

Return Type:

EventHandler Parameters

NAME
TYPE
DESCRIPTION
event

The event that occurred.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

Get the ID of the video box whose video has ended

Copy Code
1$w("#myVideoBox").onEnded( (event) => {
2 let targetId = event.target.id; // "myVideoBox"
3});