video.js - Videojs TypeError: this.addEvent is not a function -


really don't know what's wrong code! i'm tryng attach end event player error in firefox console:

"typeerror: this.addevent not function"

i tried in many way, coudnt solve problem!

<!doctype html> <html> <head>   <link href="video-js.css" rel="stylesheet" type="text/css">   <script src="video.js"></script>   <script>_v_.options.flash.swf = "video-js.swf";</script> </head> <body>   <video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="400" height="500" data-setup='{}'       poster="http://video-js.zencoder.com/oceans-clip.png">     <source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4' />     <source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm' />     <source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg' />     <track kind="captions" src="demo.captions.vtt" srclang="en" label="english" />   </video> <script> var myplayer = videojs("example_video_1");  videojs("example_video_1").ready(function(){     var myplayer = this;      var videoend = function(){       console.log('ended')     };      myplayer.addevent("ended", videoend);  }); </script> </body> </html> 

can u me please? lot

video.js has been updated version 4 , things in api have changed. you'll need use myplayer.on("ended", videoend);

api docs: https://github.com/videojs/video.js/blob/master/docs/api/vjs.player.md


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -