Improved player UI auto hide

This commit is contained in:
WardPearce
2026-01-21 20:59:06 +13:00
parent c7dad017a3
commit 025a46b785
3 changed files with 18 additions and 7 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "Materialious",
"version": "1.13.6",
"version": "1.13.7",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "Materialious",
"version": "1.13.6",
"version": "1.13.7",
"license": "MIT",
"dependencies": {
"@capacitor-community/electron": "^5.0.0",
+15 -4
View File
@@ -87,7 +87,7 @@
};
let originalOrigination: ScreenOrientationResult | undefined;
let watchProgressInterval: ReturnType<typeof setTimeout>;
let watchProgressInterval: ReturnType<typeof setInterval>;
let showVideoRetry = $state(false);
let androidInitialNetworkStatus: ConnectionStatus | undefined;
@@ -585,7 +585,16 @@
}
}
function showPlayerUI() {}
let showPlayerUiTimeout: ReturnType<typeof setTimeout>;
function showPlayerUI() {
showControls = true;
if (showPlayerUiTimeout) clearTimeout(showPlayerUiTimeout);
showPlayerUiTimeout = setTimeout(() => {
showControls = false;
}, 5000);
}
onMount(async () => {
shaka.polyfill.installAll();
@@ -1143,7 +1152,7 @@
Mousetrap.unbind(['left', 'right', 'space', 'c', 'f', 'shift+left', 'shift+right', 'enter']);
if (watchProgressInterval) clearTimeout(watchProgressInterval);
if (watchProgressInterval) clearInterval(watchProgressInterval);
if (sabrAdapter) sabrAdapter.dispose();
@@ -1165,7 +1174,9 @@
class:hide={showVideoRetry}
role="presentation"
onclick={onVideoClick}
onmouseenter={() => (showControls = true)}
onmouseenter={showPlayerUI}
onmousemove={showPlayerUI}
onscroll={showPlayerUI}
onmouseleave={() => (showControls = false)}
bind:this={playerContainer}
>
File diff suppressed because one or more lines are too long