Revert fix

This commit is contained in:
goodtube4u
2025-06-18 21:14:21 +10:00
parent 935f50261f
commit 88c234a662

View File

@@ -491,9 +491,6 @@
// Setup player dynamic positioning and sizing
goodTube_player_positionAndSize();
// Fix fullscreen controls not hiding
goodTube_player_hideControlsFullscreen();
// Run the actions
goodTube_actions();
}
@@ -645,29 +642,6 @@
goodTube_player.contentWindow.postMessage('goodTube_play', '*');
}
// Fix fullscreen controls not hiding
function goodTube_player_hideControlsFullscreen() {
document.addEventListener('fullscreenchange', () => {
if (document.fullscreenElement) {
setTimeout(() => {
const fakeMove = new MouseEvent('mousemove', {
bubbles: true,
clientX: 1,
clientY: 1,
});
document.dispatchEvent(fakeMove);
}, 3000);
setTimeout(() => {
const el = document.elementFromPoint(1, 1);
if (el) {
el.dispatchEvent(new MouseEvent('click', { bubbles: true }));
}
}, 3100);
}
});
}
/* Keyboard shortcuts
------------------------------------------------------------------------------------------ */
@@ -780,6 +754,10 @@
// Pass the keyboard shortcut to the iframe
goodTube_player.contentWindow.postMessage('goodTube_shortcut_' + keyPressed, '*');
// Force mouse move to make sure fullscreen hides
var event = new Event('mousemove');
document.dispatchEvent(event);
}
// Toggle picture in picture
@@ -2640,6 +2618,10 @@
if (fullScreenButton) {
fullScreenButton.click();
}
// Force mouse move to make sure fullscreen hides
var event = new Event('mousemove');
document.dispatchEvent(event);
}
// Prev 10 seconds