WIP: global player pt. 4 fixed mobile

This commit is contained in:
2026-02-10 00:01:32 -08:00
parent a4cf9356a8
commit 4fb1d7865f
2 changed files with 13 additions and 7 deletions

View File

@@ -78,7 +78,12 @@
if (audioEl) {
if (track) {
const newSrc = track.src;
if (audioEl.src !== newSrc) {
const currentSrc = audioEl.currentSrc;
// Create absolute URL for comparison if needed, or rely on currentSrc
// audioEl.src sets the attribute, currentSrc is the resolved URL
const newSrcAbsolute = new URL(newSrc, document.baseURI).href;
if (currentSrc !== newSrcAbsolute) {
audioEl.src = newSrc;
audioEl.play().catch((e) => {
console.warn("Autoplay blocked or failed", e);

View File

@@ -43,13 +43,14 @@
</main>
<!-- Desktop sidebar column (in normal flow) -->
<aside class="hidden lg:block">
<ClientOnly showFallback={false}>
{#snippet children()}
<!-- PlayerRoot uses contents to inject its children into this grid -->
<ClientOnly showFallback={false}>
{#snippet children()}
<div class="contents">
<PlayerRoot />
{/snippet}
</ClientOnly>
</aside>
</div>
{/snippet}
</ClientOnly>
</div>
<!-- Mobile player UI is rendered via a portal from the single GlobalPlayer instance