mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00

The initial text in compressed mode was still Theater. And changed the location of the button to be more in style. The it will be before the pip or fullscreen button and not that the resolution button will be in between.
29 lines
930 B
JavaScript
29 lines
930 B
JavaScript
$(document).ready(function () {
|
|
// Extend default
|
|
setTimeout(function(){
|
|
if (typeof player == 'undefined') {
|
|
player = videojs(videoJsId);
|
|
}
|
|
// Extend default
|
|
var Button = videojs.getComponent('Button');
|
|
var Theater = videojs.extend(Button, {
|
|
//constructor: function(player, options) {
|
|
constructor: function () {
|
|
Button.apply(this, arguments);
|
|
this.addClass('ypt-compress');
|
|
this.addClass('vjs-button-fa-size');
|
|
this.controlText("Theater mode");
|
|
if (Cookies.get('compress') === "true") {
|
|
toogleEC(this);
|
|
}
|
|
},
|
|
handleClick: function () {
|
|
toogleEC(this);
|
|
}
|
|
});
|
|
|
|
// Register the new component
|
|
videojs.registerComponent('Theater', Theater);
|
|
player.getChild('controlBar').addChild('Theater', {}, getPlayerButtonIndex('CaptionsButton') + 1);
|
|
}, 30);
|
|
});
|