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,48 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Party Player — Queue</title>
|
||||
<link rel="stylesheet" href="/queue/queue.css" />
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Queue</h1>
|
||||
<div id="status" class="offline">offline</div>
|
||||
</header>
|
||||
|
||||
<form id="add-form" autocomplete="off">
|
||||
<input
|
||||
id="url"
|
||||
type="text"
|
||||
placeholder="Paste a YouTube URL…"
|
||||
aria-label="YouTube URL"
|
||||
required
|
||||
/>
|
||||
<button type="submit">Add</button>
|
||||
</form>
|
||||
<p id="error" hidden></p>
|
||||
|
||||
<div id="totals">
|
||||
<div class="total">
|
||||
<span class="label">Remaining</span>
|
||||
<span class="value" id="remaining">0:00</span>
|
||||
</div>
|
||||
<div class="total">
|
||||
<span class="label">Total</span>
|
||||
<span class="value" id="total">0:00</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ol id="list"></ol>
|
||||
<p id="empty">Nothing queued yet.</p>
|
||||
|
||||
<footer>
|
||||
<span class="label">Background</span>
|
||||
<div id="backgrounds"></div>
|
||||
</footer>
|
||||
|
||||
<script type="module" src="/queue/queue.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user