aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/music-player.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/music-player.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/music-player.js27
1 files changed, 16 insertions, 11 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/music-player.js b/packages/meshbay-hub/src/meshbay_hub/static/music-player.js
index c3a28689..5f2e33c5 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/music-player.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/music-player.js
@@ -8,7 +8,7 @@ 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).
+ * The Music app's persistent player bar (docs/MESHBAY_DESIGN.md §9.8).
*
* Owned and rendered by app.js — the router's parent — so playback survives
* navigating between groups, search, and other pages. Both group-page.js
@@ -23,11 +23,12 @@ import { CHUNK_SIZE, pipelinedDownload } from './file-utils.js';
* 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
- * <audio> element at all, tagged correctly or not, so those two go through
- * `transport.requestAudioTranscode` first — a node-side, cached-after-once
- * AAC/M4A conversion — before the same download/blob path runs.
+ * simplification recorded in docs/MESHBAY_DESIGN.md §9.8. WMA and Musepack are
+ * the one exception (`NEEDS_TRANSCODE_RE` below): neither decodes in a
+ * browser's <audio> element at all, tagged correctly or not, so those two go
+ * through `transport.requestAudioTranscode` first — a node-side,
+ * cached-after-once AAC/M4A conversion — before the same download/blob path
+ * runs.
*/
const MIME_BY_EXT = {
@@ -35,9 +36,12 @@ const MIME_BY_EXT = {
wav: 'audio/wav', aac: 'audio/aac', m4a: 'audio/mp4',
};
-// Kept in sync with the node's BROWSER_INCOMPATIBLE_AUDIO_EXTS
-// (webrtc_server.py) — both name the same two formats no mainstream
-// browser's <audio> element decodes natively.
+// The same two formats as the node's BROWSER_INCOMPATIBLE_AUDIO_EXTS
+// (webrtc_server.py), which is the one that decides: the node refuses a
+// transcode request for anything else. This is here so the player does not
+// ask for one it knows will be refused — not because it enforces the rule.
+// It used to be the only thing that did, and a member's own message never
+// passed through it.
const NEEDS_TRANSCODE_RE = /\.(wma|mpc)$/i;
function guessMime(name) {
@@ -271,7 +275,7 @@ function MusicPlayerBar({ getConnection, queue, onClose, userPrefs, onSaveQueue
// Screen Wake Lock, opt-in only (Settings → music_keep_screen_on) and only
// while a track is actually playing — off by default because the ordinary
// expectation, matching Spotify/Deezer, is that the phone locks on its own
- // idle timer while listening (docs/musicbay.md §2.2). Unlike the video
+ // idle timer while listening (docs/MESHBAY_DESIGN.md §9.8). Unlike the video
// player's unconditional lock, this must not fight that default for
// everyone who never asked for it; it exists for whoever explicitly wants
// to trade battery for riding out the WebRTC screen-lock reconnect gap
@@ -368,7 +372,8 @@ function MusicPlayerBar({ getConnection, queue, onClose, userPrefs, onSaveQueue
}, [getConnection, evictOldBlobs]);
// Silently warms the cache for the next tracks so pressing "next" doesn't
- // visibly wait (musicbay.md §2.2) — best-effort, never surfaces an error.
+ // visibly wait (docs/MESHBAY_DESIGN.md §9.8) — best-effort, never surfaces
+ // an error.
//
// More than one: a screen lock can cost the transport several minutes (see
// the WebRTC auto-reconnect in transport.js — this is the other half of