Hide the cursor over the video once the bottom bar auto-hides
Some checks failed
Publier l'image Docker / test (pull_request) Failing after 15s
Publier l'image Docker / publish (pull_request) Has been skipped

Asked for directly: the auto-hide behavior itself (bottom bar collapses
to just its seek line after a stretch of no activity) already shipped
earlier - a mouse cursor left sitting over the video afterward is the
same kind of clutter that was the point of hiding in the first place.

.playerWrap now gets a .cursorHidden class alongside #bottomBar's own
.minimal, toggled at the exact same two call sites
(scheduleControlsHide/showControls) so the two states can never drift
out of sync with each other. cursor: none on that class does the rest -
no new listener needed, since playerWrap's own pointermove/pointerdown
already call showControls() on any mouse activity, which is exactly
when the cursor should reappear too.

Verified: typecheck + build (client). Confirmed the compiled bundle
carries both the classList calls and the CSS rule. Not verified in an
actual running player - no Emby login reachable from this sandbox to
open a real video party and let the auto-hide timer elapse.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Nicolas 2026-09-15 22:50:08 +02:00
parent 78b6b00ae2
commit 26d32632c7
2 changed files with 16 additions and 1 deletions

View file

@ -16,6 +16,15 @@
object-fit: contain;
}
/* Toggled alongside .bottomBar.minimal (see Player.ts's scheduleControlsHide/
showControls) - a mouse cursor left sitting over the video is the same
kind of clutter the bar itself was, once there's nothing left under it
to interact with. Any pointermove/pointerdown anywhere in .playerWrap
already calls showControls(), so the cursor reappears the instant the
mouse moves again - same convention as any other video player's
auto-hiding controls. */
.playerWrap.cursorHidden { cursor: none; }
/* Two stacked rows, both part of the same top gradient overlay: the action
bar (title/members/next/settings/leave) and, below it, the presence
avatars - see .presenceOverlay in styles/presence.css. Stacking them in

View file

@ -530,7 +530,11 @@ function renderVideoPlayer(root: HTMLElement, partyId: string, party: PartyPubli
* sitting on the bar itself, and re-arms on every discrete playback
* event too (onDriverStateChanged above), not just raw pointer
* activity - resuming from pause has to restart the countdown, not
* leave the bar stuck open forever.
* leave the bar stuck open forever. .playerWrap also gets
* .cursorHidden alongside .minimal (see Player.css) - asked for
* directly too: a mouse cursor left sitting over the video is exactly
* the same kind of clutter the bar itself was, once there's nothing
* left under it to interact with.
*/
function clearControlsHideTimer() {
if (controlsHideTimer) {
@ -544,11 +548,13 @@ function renderVideoPlayer(root: HTMLElement, partyId: string, party: PartyPubli
controlsHideTimer = window.setTimeout(() => {
if (activeDriver.paused || isPointerOverBottomBar) return;
bottomBar.classList.add('minimal');
playerWrap.classList.add('cursorHidden');
}, CONTROLS_HIDE_DELAY_MS);
}
function showControls() {
bottomBar.classList.remove('minimal');
playerWrap.classList.remove('cursorHidden');
scheduleControlsHide();
}