【发布时间】:2015-10-05 00:30:01
【问题描述】:
我目前正在为 video.js 构建一个插件,该插件会在某些断点处在屏幕上呈现叠加层。但是,我无法在不启动视频的情况下单击任何叠加层。我想我需要禁用播放器上的点击播放功能。
我应该如何禁用/启用 video.js 播放器的点击播放功能?
function createBreak(breakpoint){
player.pause();//pause the playback
player.getChild('controlBar').hide();//hide the controlbar
breakpoint.resolved = true;//
var button = createEl('button',{});//adds button to video.js parent <div>
button.innerHTML = "continue";//
//THE PROBLEM: this button cannot be clicked (this is just a proof of concept)
// because clicking on it will restart the player
//WHAT I NEED: a function that can disable the click-to-play
}
This solution 已经存在,但它似乎只适用于旧版本的 video.js
【问题讨论】:
-
请将您遇到问题的代码添加到问题中。这将帮助您获得更好的答案。
-
我正在使用的代码没有任何具体问题,但我会发布上下文
标签: javascript video.js