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,24 @@
|
||||
// Central knobs for the party player.
|
||||
|
||||
export const PORT = Number(process.env.PORT) || 3000;
|
||||
|
||||
// Seconds of overlap between the outgoing and incoming video.
|
||||
// Audio and video crossfade over this whole window.
|
||||
export const OVERLAP_SECONDS = 5;
|
||||
|
||||
// How fast the player switches when the user jumps around manually.
|
||||
export const HARD_CUT_SECONDS = 0.4;
|
||||
|
||||
// The video frame takes up this fraction of the screen.
|
||||
export const FRAME_SCALE = 0.3;
|
||||
|
||||
// Pixels per second the frame drifts across the screen.
|
||||
export const BOUNCE_SPEED = 90;
|
||||
|
||||
// Selectable fullscreen backgrounds, keyed by the id sent over the socket.
|
||||
export const BACKGROUNDS = {
|
||||
pink: { label: 'Pink', src: '/assets/PLAKAT_A2_pink_426x600mm.png' },
|
||||
plain: { label: 'Classic', src: '/assets/PLAKAT_A2_426x600mm.png' },
|
||||
};
|
||||
|
||||
export const DEFAULT_BACKGROUND = 'pink';
|
||||
Reference in New Issue
Block a user