Search.../

play( )

Begins or resumes playback.

Description

The play() function plays the audio track and fires a play event.

The play event handlers set on the audio player by the onPlay( ) function are called.

Syntax

function play(): Promise<void>

play Parameters

This function does not take any parameters.

Returns

Fulfilled - When playback begins or resumes.

Return Type:

Promise<void>

Was this helpful?

Begin or resume playback

Copy Code
1$w("#myAudioPlayer").play();
Begin or resume playback and log a message when done

Copy Code
1$w("#myAudioPlayer").play()
2 .then( () => {
3 console.log("Done with play");
4 } );