import { html, useState, useEffect, useRef, useCallback, } from './vendor/htm-preact.js'; import { t } from './i18n.js'; import { Icon } from './icon.js'; import { useStickyBand } from './sticky.js'; import { CHUNK_SIZE, pipelinedDownload } from './file-utils.js'; /** * The Music app's persistent player bar (docs/musicbay.md §2.3, §7.2). * * Owned and rendered by app.js — the router's parent — so playback survives * navigating between groups, search, and other pages. Both group-page.js * and search-page.js trigger playback by calling `onPlayQueue(tracks, * startIndex)`, which flows up to app.js. * * Each track carries a `groupId`; the player calls `getConnection(groupId)` * per track to obtain the right transport — a pool-based lazy connection * that transparently handles single-group and cross-group queues. * * No streaming, no MSE, no node-side transcode pool for the common case: a * track is a few megabytes, so it is downloaded and decrypted once through * the same chunk pipeline Files already uses (file-utils.js's * pipelinedDownload), then played from a blob URL — the deliberate * simplification recorded in musicbay.md §2.2. WMA and Musepack are the one * exception (`NEEDS_TRANSCODE_RE` below): neither decodes in a browser's *