如何停止暂停视频的video-js onclick事件 [英] How to stop video-js onclick event from pausing video
本文介绍了如何停止暂停视频的video-js onclick事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在这里有一个简单的JSFiddle: http://jsfiddle.net/cvCWc/2/
I have a simple JSFiddle here: 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();
});
我正在尝试捕获视频中的所有点击事件以供将来处理,但是我不希望视频在点击时暂停.有什么想法吗?
I am trying to capture all click events on the video for future processing, but I don't want the video to pause when clicked. Any ideas?
推荐答案
我找到了HTML5的答案...但是我没有在Flash后备广告中获得点击事件.更新的jsfdl: http://jsfiddle.net/cvCWc/3/
I found the answer for HTML5... but I don't get click events in the flash fallback. Updated 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();
});
这篇关于如何停止暂停视频的video-js onclick事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文