Revert "experiment(web): drop separate preload <audio> element (single-element like Navidrome)"

This reverts commit f252586398.
This commit is contained in:
Honey committed 2026-06-26 21:50:06 +02:00
1 parent e1ec1f3660
commit be73f717ac
1 file changed
+8 -5
+8 -5
View File
@@ -293,11 +293,14 @@ function _preloadNext() {
const ni = _nextIdx(); const ni = _nextIdx();
if(ni < 0) return; if(ni < 0) return;
const next = S.queue[ni]; const next = S.queue[ni];
if(!next) return; if(!next || _preId === next.id) return;
// (b) EXPERIMENT — no separate preload <audio> element. Navidrome's player keeps a single _preId = next.id;
// element only; a second buffering media element appears to make Chromium flip the OS media _preUrl = streamUrl(next.id);
// session on skip (Windows tile flicker). We rely on the main element's preload="auto" + the // Real Audio preload — actually buffers the stream so canplay fires instantly
// browser HTTP cache instead, and just warm the next cover art. Easy to revert if it doesn't help. if(_preAudio) { _preAudio.src = ''; _preAudio = null; }
_preAudio = new Audio();
_preAudio.preload = 'auto';
_preAudio.src = _preUrl;
if(next.coverArt) { if(next.coverArt) {
[256, 512, 1024].forEach(size => { [256, 512, 1024].forEach(size => {
const img = new Image(); const img = new Image();