Create event to check display duration of images, similar to video in HTML5

Asked

Viewed 74 times

0

Guys, I was checking out the tag video of Html5 and saw that this has enough control events, as that, so it is possible to know when a video is about to end and also trigger an event when it ends.

I wonder if there is something similar to image, for example, if I wanted to make an image and video player, how would I know that an image that has to play X time is about to end without having to have a setInterval checking the current time and the time of the image to know whether or not it has finished.

Has anyone ever done anything like this? Any tips?

  • Image player?

  • Yeah, it’s just an example

  • You want to know when it finishes being loaded ?

  • In the title is kind of "nothing to do" with the question.

  • No, for example, a video has a duration of 10s. With the video tag, I can trigger an event (I believe so) when the video finishes running. And if I want an image to run for 10 seconds, I can create events for that?

  • Yes, you can do event while running the image appears and when the video event has finished you hide the image

  • can try using the setTimeout()

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.