How to check if background video has loaded?

1.6k Views Asked by At

Hoping you can help. I am wondering if its possible to check if a background video has loaded?

In the past I have used imagesLoaded to check if a background image has loaded but I was hoping I could do similar for a background video?

Any help/advice would be greatly appreciated.

Thanks!

1

There are 1 best solutions below

0
Mick On

Assuming you are looking at a HTML5 implementation, the HTML5 video tag supports a callback for video loaded:

var myVideo = document.getElementById("myBackgroundVideoID");
myVideo.onloadeddata = function() {
    //Do whatever you  want when video is loaded here
};