真的不知道我的代码有什么问题!我试图通过在我的 Firefox 控制台中收到此错误来将结束事件附加到我的播放器:
“TypeError:this.addEvent 不是函数”
我尝试了很多方法,但无法解决这个问题!
<!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>
你能帮帮我吗?多谢