1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-04 02:09:22 +02:00
Oinktube/plugin/PlayerSkins/autoplayButton.js
2021-05-24 11:25:18 -03:00

23 lines
No EOL
795 B
JavaScript

var Button = videojs.getComponent('Button');
var autoplayButton = videojs.extend(Button, {
//constructor: function(player, options) {
constructor: function () {
Button.apply(this, arguments);
this.addClass('autoplay-button');
this.controlText("autoplay");
setTimeout(function(){avideoTooltip(".autoplay-button","Autoplay");},1000);
},
handleClick: function () {
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();