1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00
Oinktube/plugin/PlayerSkins/autoplayButton.js
2023-06-30 11:41:25 -03:00

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();