mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-04 02:09:22 +02:00
23 lines
No EOL
795 B
JavaScript
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(); |