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

20 lines
525 B
JavaScript

var Button = videojs.getComponent('Button');
class LoopButton extends Button {
constructor() {
super(...arguments);
this.addClass('loop-button');
if (!isPlayerLoop()) {
this.addClass('loop-disabled-button');
} else {
this.addClass('fa-spin');
}
this.controlText("Loop");
}
handleClick() {
tooglePlayerLoop();
}
}
videojs.registerComponent('LoopButton', LoopButton);
player.getChild('controlBar').addChild('LoopButton', {}, 0);