fix: preload hi-res NP cover on track change so overlay opens instantly

_crossfadeNpBg only preloaded the 1024px cover when the NP overlay was
already open. Opening it fresh showed the old cover for ~0.5s while the
new image downloaded. Preloading in updatePlayerUI caches it immediately.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-05-14 19:49:57 +02:00
1 parent 30ef5300cf
commit c037ee623d
1 file changed
+3
+3
View File
@@ -381,6 +381,9 @@ export function updatePlayerUI(s, _skipMediaSession = false) {
}));
} catch {}
_syncNpDirect(s);
// Preload the hi-res NP cover now so opening the overlay is instant
const _npCv = coverUrl(s.coverArt, 1024);
if (_npCv && _npCv !== _npBgLastUrl) { const _pre = new Image(); _pre.src = _npCv; }
}
let _npBgCurr = 'a';