Executing function at end of html5 video

前端 未结 6 1548
南方客
南方客 2021-01-01 09:19

I have a html video, and I am wanting to run a function when a video ends. I have tried the following but I get nothing:

$(document).ready(function(){

    $         


        
6条回答
  •  独厮守ぢ
    2021-01-01 10:14

    You can use on in the place of live. Because on method is supported by jquery new versions and live is deprecated in new versions.

    You can replace your code to this and your problem will be solved.

    $(document).ready(function(){
    
    $('video').on('ended',function(){
    
        alert('video ended');
    
    });
    

    });

提交回复
热议问题