onEnded( )


Adds an event handler that runs when playback has ended.

An audio track ends when playback reaches the duration of the audio.

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

Method Declaration
Copy
Method Parameters
handlerfunctionRequired

handler(event: Event): void The name of the function or the function expression to run when the audio track has ended.

Returns
Return Type:AudioPlayer
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?