版本:7.8.4
不知道为什么handleClick方法没有生效,所以我覆盖了这个方法。
var CloseButton = videojs.getComponent('CloseButton');
CloseButton.prototype.handleClick = () => onClose();
var closeButton = new CloseButton(lPlayer);
lPlayer.addChild(closeButton);
参考文章:
https://docs.videojs.com/tutorial-components.html (官方)
https://docs.videojs.com/close-button.js.html (官方)
本文解决Video.js中CloseButton点击事件不触发的问题,通过覆盖handleClick方法实现关闭按钮的功能。参考了官方文档和社区文章,提供了一种可行的解决方案。
1418

被折叠的 条评论
为什么被折叠?



