【发布时间】:2015-04-14 03:49:19
【问题描述】:
虽然我已经能够使用普通 HTML5 播放器收听“timeupdate”事件,但我似乎无法让它与 video.js 一起使用。
这是我的代码:
<!DOCTYPE html>
<html>
<head>
<link href="video-js.css" rel="stylesheet">
<script src="video.js"></script>
<script src="jquery.min.js"></script>
</head>
<body>
<video id="testvid" class="video-js vjs-default-skin" controls width="640" height="480" data-setup='{}'>
<source src="testvideo.mp4" type="video/mp4">
</video>
</body>
</html>
<script>
videojs('testvid').ready(function(){
var myPlayer = this;
$(myPlayer).bind('timeupdate', function(){
console.log('the time was updated to: ' + this.currentTime);
});
});
</script>
我是否误解了 video.js 的基本运作方式?
【问题讨论】:
标签: javascript html video.js