mirror of
https://github.com/goodtube4u/goodtube.git
synced 2025-11-22 10:16:11 +00:00
Revert fix
This commit is contained in:
34
goodtube.js
34
goodtube.js
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user