mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
20 lines
525 B
JavaScript
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);
|