Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Oct 29, 2024
1 parent 2440322 commit 7320361
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion plugin/PlayLists/embed.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ function updatePLSources(_index) {
return false;
});

addCloseButtonInVideo();
addCloseButtonInVideo(<?php echo json_encode(!empty($_REQUEST['forceCloseButton'])); ?>);
});

function compare(a, b, type) {
Expand Down
12 changes: 6 additions & 6 deletions view/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -4031,15 +4031,15 @@ function openFullscreenVideo(url, urlBar) {
fullscreenIframe.appendTo('body');
}

function addCloseButtonInVideo() {
function addCloseButtonInVideo(forceButton = false) {
try {
// If either function exists, add a close button inside videojs
if (window.self !== window.top) {
if (window.self !== window.top || forceButton) {
if (typeof player !== 'object') {
setTimeout(function () { addCloseButtonInVideo(); }, 2000);
setTimeout(function () { addCloseButtonInVideo(forceButton); }, 2000);
return false;
}
addCloseButton($(player.el()));
addCloseButton($(player.el()), forceButton);
}
} catch (error) {

Expand All @@ -4066,9 +4066,9 @@ function closeFullScreenOrHistoryBack(){
}
}

function addCloseButton(elementToAppend) {
function addCloseButton(elementToAppend, forceButton = false) {
// If either function exists, add a close button inside videojs
if (window.self !== window.top) {
if (window.self !== window.top || forceButton) {
var closeButton = $('<button>', {
'id': 'CloseButtonInVideo',
});
Expand Down
2 changes: 1 addition & 1 deletion view/videoEmbeded.php
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@
var topInfoTimeout;

$(document).ready(function() {
addCloseButtonInVideo();
addCloseButtonInVideo(<?php echo json_encode(!empty($_REQUEST['forceCloseButton'])); ?>);
$("iframe").mouseout(function(e) {
topInfoTimeout = setTimeout(function() {
$('#mainVideo').removeClass("vjs-user-active");
Expand Down

0 comments on commit 7320361

Please sign in to comment.