video.js自定义控制按钮
// 视频播放
if (!this.player) {
let that = this
this.player = videojs("#videoPlayer", this.videoOptions, function onPlayerReady(this:any) {
console.log('onPlayerReady', this);
// var hdButtonEl = videojs.createEl('button', { className: 'vjs-hd-button vjs-control',
// 'role': 'button'
// });
// const hdButton = new videojs.BigPlayButton(this.player_, this.videoOptions);
// console.log(hdButton, 'hdButton')
// new videojs.BigPlayButton(this.player_, { children: [] });
this.on('ended',function(next){
console.log('ended', next);
that.nextVideo()
})
})
console.log('player', this.player);
this.$nextTick(() => {
/* ADD PREVIOUS */
var Button = videojs.getComponent('Button');
// // Extend default
// var PrevButton = videojs.extend(Button, {
// //constructor: function(player, options) {
// constructor: function() {
// Button.apply(this, arguments);
// //this.addClass('vjs-chapters-button');
// this.addClass('icon-angle-left');
// this.controlText("Previous");
// },