I think there are a lot of possibilities of how to detect if a video is playing or not.
When using a VIDEO → every VIDEO has a specific playtime.
Let us first take a quick look onto the Wix-VideoPlayer-API…
https://www.wix.com/velo/reference/$w/videoplayer
So which of the offered options you could use for your needs?
- currentTime → Could we maybe use this one? → maybe!
- duration → Could we maybe use this one? → maybe!
- isPlaying → Could we maybe use this one? → maybe also possible!
But what about this one ???
onEnded( )
$w("#myVideoPlayer").onEnded((event) => {
let targetId = event.target.id; // "myVideoPlayer"
});
This should give you back as result the current ID of your VIDEO-ELEMENT, whose play-time has been ended (stopped)!