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:
1 parent
30ef5300cf
commit
c037ee623d
1 file changed
+3
@@ -381,6 +381,9 @@ export function updatePlayerUI(s, _skipMediaSession = false) {
|
|||||||
}));
|
}));
|
||||||
} catch {}
|
} catch {}
|
||||||
_syncNpDirect(s);
|
_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';
|
let _npBgCurr = 'a';
|
||||||
|
|||||||
Reference in new issue
Block a user