mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-06 03:50:04 +02:00
Update
This commit is contained in:
parent
f40794f03d
commit
68574750cc
1 changed files with 10 additions and 6 deletions
|
@ -4057,6 +4057,15 @@ function addCloseButtonInPage() {
|
|||
}
|
||||
}
|
||||
|
||||
function closeFullScreenOrHistoryBack(){
|
||||
if (window.self !== window.top) {
|
||||
window.parent.postMessage('closeFullscreen', '*');
|
||||
} else {
|
||||
console.log('close history.back');
|
||||
window.history.back();
|
||||
}
|
||||
}
|
||||
|
||||
function addCloseButton(elementToAppend) {
|
||||
// If either function exists, add a close button inside videojs
|
||||
if (window.self !== window.top) {
|
||||
|
@ -4069,12 +4078,7 @@ function addCloseButton(elementToAppend) {
|
|||
closeButton.html('<i class="fas fa-times"></i>');
|
||||
// Add event listener
|
||||
closeButton.on('click', function () {
|
||||
if (window.self !== window.top) {
|
||||
window.parent.postMessage('closeFullscreen', '*');
|
||||
} else {
|
||||
console.log('close history.back');
|
||||
window.history.back();
|
||||
}
|
||||
closeFullScreenOrHistoryBack();
|
||||
});
|
||||
// Append the close button to the Video.js player
|
||||
elementToAppend.append(closeButton);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue