Add party player: YouTube queue with crossfading playback
Two frontends sharing one WebSocket-backed state on the server: - Player: fullscreen poster background with a small frame (30% of the screen) that drifts diagonally and reflects off the edges. Two stacked YouTube players hand over with a 5s equal-power crossfade so there is never silence between tracks. - Queue: add by URL, drag to reorder, delete, click to jump. Shows title and length per item, highlights what is playing, and tracks remaining vs. total playtime. No API key is required — titles come from YouTube's oEmbed endpoint and durations from a hidden muted probe player that cues each new video just to read its length. The fade is driven by both requestAnimationFrame and the interval tick: a hidden or throttled tab stops serving frames entirely, which would otherwise strand a handover half-faded with two tracks audible. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tg15tLAuT6NrCE1ZxKVgDB
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Party Player</title>
|
||||
<link rel="stylesheet" href="/player/player.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="backgrounds"></div>
|
||||
|
||||
<!-- #frameMover owns the motion transform and nothing else, so future
|
||||
animations can nest their own transform layers without conflict. -->
|
||||
<div id="frameMover">
|
||||
<div id="frameSkin">
|
||||
<div class="deck" data-deck="a"><div id="deck-a"></div></div>
|
||||
<div class="deck" data-deck="b"><div id="deck-b"></div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Offscreen, muted, 1x1: cues queued videos purely to read their length. -->
|
||||
<div id="probe"><div id="probe-player"></div></div>
|
||||
|
||||
<div id="gate">
|
||||
<div class="gate-inner">
|
||||
<h1>Party Player</h1>
|
||||
<p id="gate-hint">Loading queue…</p>
|
||||
<button id="start" type="button" disabled>Start</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="status" hidden>reconnecting…</div>
|
||||
|
||||
<script type="module" src="/player/player.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user