close
如何自訂video js的onclick事件,不要是預設的"暫停播放"功能
在初始化videojs物件時,去重新定義on click事件,並加上event.preventDefault();就可以停止預設的onclick事件。
--
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();
});
--
轉自 https://stackoverflow.com/questions/21470677/how-to-stop-video-js-onclick-event-from-pausing-video
全站熱搜
留言列表