Search.../

isPlaying

Indicates if the element is currently playing.

Description

To set the isPlaying property on an element, use the element's play() and pause() functions.

If you select Autoplays on loading in the element's Settings panel in the Editor, the isPlaying property is set to true when the page loads.

Type:

booleanRead Only
Mixed in from:$w.PlayableMixin

Related Content:

Was this helpful?

Get an element's current playing status

Copy Code
1let isPlaying = $w("#myElement").isPlaying; // false
Toggle an element's current playing state

Copy Code
1if( $w("#myElement").isPlaying ) {
2 $w("#myElement").pause();
3}
4else {
5 $w("#myElement").play();
6}