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

videojs update

This commit is contained in:
Daniel Neto 2023-06-30 11:41:25 -03:00
parent 7581f1e883
commit 87721585c1
10 changed files with 95 additions and 93 deletions

View file

@ -1,24 +1,26 @@
// Extend default
$(document).ready(function () {
setTimeout(function(){ if(typeof player == 'undefined'){player = videojs(videoJsId);}
setTimeout(function() {
if(typeof player == 'undefined') {
player = videojs(videoJsId);
}
var Button = videojs.getComponent('Button');
var nextButton = videojs.extend(Button, {
//constructor: function(player, options) {
constructor: function () {
Button.apply(this, arguments);
//this.addClass('vjs-chapters-button');
class NextButton extends Button {
constructor() {
super(...arguments);
this.addClass('next-button');
this.addClass('vjs-button-fa-size');
this.controlText("Next");
},
handleClick: function () {
}
handleClick() {
document.location = autoPlayVideoURL;
}
});
}
// Register the new component
videojs.registerComponent('nextButton', nextButton);
player.getChild('controlBar').addChild('nextButton', {}, getPlayerButtonIndex('PlayToggle')+1);
}, 30); });
videojs.registerComponent('NextButton', NextButton);
player.getChild('controlBar').addChild('NextButton', {}, getPlayerButtonIndex('PlayToggle')+1);
}, 30);
});

View file

@ -233,24 +233,27 @@ $name = $plp->getName();
}
});
setTimeout(function () {
if (typeof player == 'undefined') {
player = videojs(videoJsId);
}
var Button = videojs.getComponent('Button');
var nextButton = videojs.extend(Button, {
//constructor: function(player, options) {
constructor: function () {
Button.apply(this, arguments);
//this.addClass('vjs-chapters-button');
class NextButton extends Button {
constructor() {
super(...arguments);
this.addClass('next-button');
this.addClass('vjs-button-fa-size');
this.controlText("Next");
},
handleClick: function () {
player.playlist.next();
}
});
handleClick() {
document.location = autoPlayVideoURL;
}
}
// Register the new component
videojs.registerComponent('nextButton', nextButton);
player.getChild('controlBar').addChild('nextButton', {}, getPlayerButtonIndex('PlayToggle') + 1);
videojs.registerComponent('NextButton', NextButton);
player.getChild('controlBar').addChild('NextButton', {}, getPlayerButtonIndex('PlayToggle') + 1);
}, 30);
});

View file

@ -1,20 +1,20 @@
var Button = videojs.getComponent('Button');
var playListProgramButton = videojs.extend(Button, {
//constructor: function(player, options) {
constructor: function () {
Button.apply(this, arguments);
class PlayListProgramButton extends Button {
constructor() {
super(...arguments);
this.addClass('playListProgram-button');
this.controlText("playListProgram");
},
handleClick: function () {
}
handleClick() {
console.log('playListProgramButton clicked');
$('#playListHolder').fadeToggle();
}
});
}
videojs.registerComponent('playListProgramButton', playListProgramButton);
player.getChild('controlBar').addChild('playListProgramButton', {}, getPlayerButtonIndex('fullscreenToggle') - 1);
videojs.registerComponent('PlayListProgramButton', PlayListProgramButton);
player.getChild('controlBar').addChild('PlayListProgramButton', {}, getPlayerButtonIndex('fullscreenToggle') - 1);
function playListFadeIn() {
$('#playListHolder').fadeIn();

View file

@ -1,14 +1,13 @@
var Button = videojs.getComponent('Button');
var autoplayButton = videojs.extend(Button, {
//constructor: function(player, options) {
constructor: function () {
Button.apply(this, arguments);
class AutoplayButton extends Button {
constructor() {
super(...arguments);
this.addClass('autoplay-button');
this.controlText("autoplay");
setTimeout(function(){avideoTooltip(".autoplay-button","Autoplay");},1000);
},
handleClick: function () {
}
handleClick() {
console.log('autoplayButton clicked');
if($('.autoplay-button').hasClass('checked')){
disableAutoPlay();
@ -16,8 +15,8 @@ var autoplayButton = videojs.extend(Button, {
enableAutoPlay();
}
}
});
}
videojs.registerComponent('autoplayButton', autoplayButton);
player.getChild('controlBar').addChild('autoplayButton', {}, getPlayerButtonIndex('fullscreenToggle') - 1);
videojs.registerComponent('AutoplayButton', AutoplayButton);
player.getChild('controlBar').addChild('AutoplayButton', {}, getPlayerButtonIndex('fullscreenToggle') - 1);
checkAutoPlay();

View file

@ -1,20 +1,20 @@
var Button = videojs.getComponent('Button');
var EPGButton = videojs.extend(Button, {
//constructor: function(player, options) {
constructor: function () {
Button.apply(this, arguments);
class EPGButton extends Button {
constructor() {
super(...arguments);
this.addClass('EPG-button');
this.controlText("TV Guide");
setTimeout(function(){avideoTooltip(".EPG-button","TV Guide");},1000);
},
handleClick: function () {
}
handleClick() {
var url = webSiteRootURL+'plugin/PlayerSkins/epg.php';
url = addQueryStringParameter(url, 'videos_id', mediaId);
console.log('epg clicked');
avideoModalIframeFullTransparent(url);
}
});
}
videojs.registerComponent('EPGButton', EPGButton);
player.getChild('controlBar').addChild('EPGButton', {}, getPlayerButtonIndex('fullscreenToggle') - 1);

View file

@ -2,17 +2,17 @@ $(document).ready(function () {
var Button = videojs.getComponent('Button');
var Logo = videojs.extend(Button, {
//constructor: function(player, options) {
constructor: function () {
Button.apply(this, arguments);
class Logo extends Button {
constructor() {
super(...arguments);
this.addClass('player-logo');
this.controlText(PlayerSkinLogoTitle);
},
handleClick: function () {
}
handleClick() {
window.open(webSiteRootURL, '_blank');
}
});
}
videojs.registerComponent('Logo', Logo);
if (player.getChild('controlBar').getChild('PictureInPictureToggle')) {

View file

@ -1,9 +1,8 @@
var Button = videojs.getComponent('Button');
var LoopButton = videojs.extend(Button, {
//constructor: function(player, options) {
constructor: function () {
Button.apply(this, arguments);
class LoopButton extends Button {
constructor() {
super(...arguments);
this.addClass('loop-button');
if (!isPlayerLoop()) {
this.addClass('loop-disabled-button');
@ -11,11 +10,11 @@ var LoopButton = videojs.extend(Button, {
this.addClass('fa-spin');
}
this.controlText("Loop");
},
handleClick: function () {
}
handleClick() {
tooglePlayerLoop();
}
});
}
videojs.registerComponent('LoopButton', LoopButton);
player.getChild('controlBar').addChild('LoopButton', {}, 0);

View file

@ -1,18 +1,18 @@
var Button = videojs.getComponent('Button');
var socialButton = videojs.extend(Button, {
//constructor: function(player, options) {
constructor: function () {
Button.apply(this, arguments);
class SocialButton extends Button {
constructor() {
super(...arguments);
this.addClass('social-button');
this.controlText("social");
setTimeout(function(){avideoTooltip(".social-button","Share");},1000);
},
handleClick: function () {
}
handleClick() {
console.log('socialButton clicked');
tooglePlayersocial();
}
});
}
videojs.registerComponent('socialButton', socialButton);
player.getChild('controlBar').addChild('socialButton', {}, getPlayerButtonIndex('fullscreenToggle') - 1);
videojs.registerComponent('SocialButton', SocialButton);
player.getChild('controlBar').addChild('SocialButton', {}, getPlayerButtonIndex('fullscreenToggle') - 1);

View file

@ -1,10 +1,10 @@
$(document).ready(function () {
var Button = videojs.getComponent('Button');
var Theater = videojs.extend(Button, {
//constructor: function(player, options) {
constructor: function () {
Button.apply(this, arguments);
class Theater extends Button {
constructor() {
super(...arguments);
if(isCompressed){
this.addClass('ypt-expand');
this.controlText("Switch to Compressed Mode");
@ -16,14 +16,13 @@ var Theater = videojs.extend(Button, {
this.addClass('hidden-sm');
this.addClass('hidden-xs');
$(this).attr('id', 'avideoTheaterButton');
},
handleClick: function () {
}
handleClick() {
toogleEC();
}
});
}
// Register the new component and set the right location as FF is not having a PIP button.
videojs.registerComponent('Theater', Theater);
});

View file

@ -118,6 +118,6 @@
}
};
vjs.plugin("persistvolume", volumePersister);
vjs.registerPlugin("persistvolume", volumePersister);
});