mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00

- Implemented `getCommentsIncludeFile` and `getBigVideoIncludeFile` methods in AVideoPlugin to allow plugins to provide custom include files for comments and big video sections. - Updated `mainArea.php` to utilize the new method for including big video files. - Added default implementations for these methods in PluginAbstract. - Modified `videoComments.php` to include comments dynamically based on the new method.
49 lines
1.6 KiB
JavaScript
49 lines
1.6 KiB
JavaScript
// Extend default
|
|
$(document).ready(function () {
|
|
setTimeout(function() {
|
|
if(typeof player == 'undefined' && typeof videoJsId != 'undefined') {
|
|
player = videojs(videoJsId);
|
|
}
|
|
|
|
var Button = videojs.getComponent('Button');
|
|
|
|
class NextButton extends Button {
|
|
constructor() {
|
|
super(...arguments);
|
|
this.addClass('next-button');
|
|
this.addClass('vjs-button-fa-size');
|
|
this.controlText("Next");
|
|
}
|
|
handleClick() {
|
|
var url = getNextPlaylistUrl();
|
|
if (empty(url)) {
|
|
url = autoPlayVideoURL;
|
|
}
|
|
document.location = url;
|
|
}
|
|
}
|
|
|
|
// Register the new component
|
|
videojs.registerComponent('NextButton', NextButton);
|
|
player.getChild('controlBar').addChild('NextButton', {}, getPlayerButtonIndex('PlayToggle')+1);
|
|
}, 30);
|
|
});
|
|
function getNextPlaylistUrl() {
|
|
// Check if '.playlist-nav' exists
|
|
if ($('.playlist-nav').length === 0) {
|
|
// If '.playlist-nav' does not exist, return false
|
|
return false;
|
|
}
|
|
|
|
// Find the active list item
|
|
var activeLi = $('.playlist-nav .navbar-nav li.active');
|
|
|
|
// Determine the next list item; if the active item is the last, wrap to the first list item
|
|
var nextLi = activeLi.is(':last-child') ? $('.playlist-nav .navbar-nav li').first() : activeLi.next();
|
|
|
|
// Get the URL from the 'a' element inside the next list item
|
|
var nextUrl = nextLi.find('a').attr('href');
|
|
|
|
// Return the URL, or false if it's not found
|
|
return nextUrl || false;
|
|
}
|