当我尝试使用最新版本的视频is 5时,下面的代码不再工作了。我正在尝试写一个视频is插件,但视频is 5使用ecmascript 6,这对我来说是新的。任何帮助都是非常感谢的。
videojs.SharingButton = videojs.Button.extend({
/** @constructor */
init: function(player, options){
videojs.Button.call(this, player, options);
this.player = player;
}
});
videojs.SharingButton.prototype.createEl = function(tagName,options) {
return videojs.Component.prototype.createEl(tagName,{
className: this.buildCSSClass(),
innerHTML: '',
role: 'button',
'aria-live': 'polite', // let the screen reader user know that the text of the button may change
tabIndex: 0
});
}
videojs.SharingButton.prototype.buttonText = 'Share Video';
videojs.SharingButton.prototype.options_ = {};
videojs.SharingButton.prototype.buildCSSClass = function(){
return 'vjs-sharing-control ';
};发布于 2015-12-08 23:44:30
嗨,我也有同样的问题,替换这个代码
videojs.SharingButton = videojs.Button.extend({
通过
var SharingButton = videojs.getComponent('Button');
videojs.SharingButton = videojs.extend(SharingButton , {...});
videojs.registerComponent('SharingButton', SharingButton);
var myButton = myPlayer.addChild('SharingButton');如果要添加一个不是player元素的直接子元素的组件,则必须爬上子元素并添加该组件。比如:
parentComponent = myPlayer.getChild('component1').getChild('component2')...
parentComponent.addChild('SharingButton')请注意,播放机组件必须启动小写,如controlBar。
在这个链接中找到组件树。
在构建5.0版本(请参阅此链接)时,进行了许多更改,不幸的是,大多数视频as插件没有更新它们的代码!主题之一是社会按钮共享
https://stackoverflow.com/questions/30896122
复制相似问题