我在这里有一个简单的JSFiddle:http://jsfiddle.net/cvCWc/2/
基本代码如下:
window.player = videojs("movie_container", { techOrder: ["html5", "slash"] }, function() {
videojs_player = this;
videojs_player.src({ src: "http://video-js.zencoder.com/oceans-clip.mp4", type: 'video/mp4'})
videojs_player.on("click", function(event){
event.preventDefault();
alert('click');
});
videojs_player.play();
});
Run Code Online (Sandbox Code Playgroud)
我正在尝试捕获视频上的所有点击事件以供将来处理,但我不希望视频在点击时暂停.有任何想法吗?
我找到了HTML5的答案......但我没有在flash后备中获得点击事件.更新了jsfdl:http://jsfiddle.net/cvCWc/3/
window.player = videojs("movie_container", { techOrder: ["html5", "flash"] }, function() {
videojs_player = this;
videojs_player.src({ src: "http://video-js.zencoder.com/oceans-clip.mp4", type: 'video/mp4'})
videojs_player.off('click');
videojs_player.on("click", function(event){
event.preventDefault();
console.log("click", event.clientX, event.clientY, videojs_player.currentTime());
});
videojs_player.play();
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9262 次 |
| 最近记录: |