Skip to content Skip to sidebar Skip to footer

How To Add Event Listener To Html5 Video Poster Image Load Event

Is it possible? I would like to attach an event listener to the poster image on HTML5 video element in order to run a code once the poster image is loaded and displayed. I'm trying

Solution 1:

Like this:

var poster = $( 'video' ).prop( 'poster' );
if ( poster ) {
    var image = new Image();
    image.onload = function () {
        alert( 'load' );
    };
    image.src = poster;
}

Post a Comment for "How To Add Event Listener To Html5 Video Poster Image Load Event"