mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
22 lines
706 B
JavaScript
22 lines
706 B
JavaScript
var Button = videojs.getComponent('Button');
|
|
|
|
class AutoplayButton extends Button {
|
|
constructor() {
|
|
super(...arguments);
|
|
this.addClass('autoplay-button');
|
|
this.controlText("autoplay");
|
|
setTimeout(function(){avideoTooltip(".autoplay-button","Autoplay");},1000);
|
|
}
|
|
handleClick() {
|
|
console.log('autoplayButton clicked');
|
|
if($('.autoplay-button').hasClass('checked')){
|
|
disableAutoPlay();
|
|
}else{
|
|
enableAutoPlay();
|
|
}
|
|
}
|
|
}
|
|
|
|
videojs.registerComponent('AutoplayButton', AutoplayButton);
|
|
player.getChild('controlBar').addChild('AutoplayButton', {}, getPlayerButtonIndex('fullscreenToggle') - 1);
|
|
checkAutoPlay();
|