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

As FF has not PIP button it can not be added behind it. So it will before fullscreen. Other browsers it will be after the pip button.
32 lines
1.2 KiB
JavaScript
32 lines
1.2 KiB
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("Default view");
|
|
if (Cookies.get('compress') === "true") {
|
|
toogleEC(this);
|
|
}
|
|
},
|
|
handleClick: function () {
|
|
toogleEC(this);
|
|
}
|
|
});
|
|
|
|
// Register the new component and set the right location as FF is not having a PIP button.
|
|
videojs.registerComponent('Theater', Theater);
|
|
if (player.getChild('controlBar').getChild('PictureInPictureToggle')){
|
|
player.getChild('controlBar').addChild('Theater', {}, getPlayerButtonIndex('PictureInPictureToggle') + 1);
|
|
} else {
|
|
player.getChild('controlBar').addChild('Theater', {}, getPlayerButtonIndex('fullscreenToggle') - 1);
|
|
}, 30);
|
|
});
|