mirror of
https://github.com/screentinker/screentinker.git
synced 2026-05-15 07:32:23 -06:00
Always show tap overlay on player cold load
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) <noreply@anthropic.com>
This commit is contained in:
parent
06ba054898
commit
f951d51214
|
|
@ -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 = `
|
||||
|
|
|
|||
Loading…
Reference in a new issue