问题
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 to figure out a way to do this but I need help.
回答1:
Like this:
var poster = $( 'video' ).prop( 'poster' );
if ( poster ) {
var image = new Image();
image.onload = function () {
alert( 'load' );
};
image.src = poster;
}
来源:https://stackoverflow.com/questions/18571424/how-to-add-event-listener-to-html5-video-poster-image-load-event