ended event videojs not working

前端 未结 5 1384

I would like to trigger a simple event when my video is finished. I\'ve placed this directly bellow my video tag.

     

        
5条回答
  •  一整个雨季
    2021-01-11 11:19

    For those who still have problems with ended events in some browsers you can resort to this fix:

        player.ready(function() {
                var myPlayer = this;
    
                playerInstance.on("timeupdate", function(event) { //chrome fix
                    if (event.currentTarget.currentTime == event.currentTarget.duration) {
                        console.log('video ended');
                    }
                });
        });
    

提交回复
热议问题