From f951d51214a364a7035a5c8df8e8ed9f5dc430df Mon Sep 17 00:00:00 2001 From: ScreenTinker Date: Tue, 28 Apr 2026 14:54:19 -0500 Subject: [PATCH] Always show tap overlay on player cold load MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Browser autoplay policy is per-document — a previous session's localStorage flag does not grant the new page autoplay rights. The 'audio previously unlocked, skipping tap overlay' branch was racing with YouTube's autoplay block, leaving the player stuck on a paused embed. Removed the skip-overlay optimization. The existing 5s auto-dismiss + muted-connect fallback still handles unattended kiosks, and a real user only needs to tap once per cold load to get audio. Co-Authored-By: Claude Opus 4.7 (1M context) --- server/player/index.html | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/server/player/index.html b/server/player/index.html index 1ddc37b..398866d 100644 --- a/server/player/index.html +++ b/server/player/index.html @@ -190,13 +190,11 @@ playCurrentItem(); } - // If audio was previously unlocked (user tapped in a prior session), skip the overlay - if (userHasInteracted) { - console.log('Audio previously unlocked, skipping tap overlay'); - unlockAudio(); - connect(config.serverUrl); - } else { - // Show tap-to-start overlay to unlock audio on auto-reconnect + // Always show the tap overlay on cold load. Browser autoplay policy is + // per-document — a localStorage flag from a prior session does not grant + // audio autoplay to a fresh page. The overlay auto-dismisses after 5s and + // connects muted, so unattended kiosks still recover without a human tap. + { const tapOverlay = document.createElement('div'); tapOverlay.style.cssText = 'position:fixed;inset:0;background:#111827;z-index:2000;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer'; tapOverlay.innerHTML = `