How can I make a video play and then disappear when my Wix page is clicked on?

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?

  1. currentTime → Could we maybe use this one? → maybe!
  2. duration → Could we maybe use this one? → maybe!
  3. 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)!