WIP: global player pt. 4 fixed mobile
This commit is contained in:
@@ -78,7 +78,12 @@
|
|||||||
if (audioEl) {
|
if (audioEl) {
|
||||||
if (track) {
|
if (track) {
|
||||||
const newSrc = track.src;
|
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.src = newSrc;
|
||||||
audioEl.play().catch((e) => {
|
audioEl.play().catch((e) => {
|
||||||
console.warn("Autoplay blocked or failed", e);
|
console.warn("Autoplay blocked or failed", e);
|
||||||
|
|||||||
@@ -43,13 +43,14 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<!-- Desktop sidebar column (in normal flow) -->
|
<!-- Desktop sidebar column (in normal flow) -->
|
||||||
<aside class="hidden lg:block">
|
<!-- PlayerRoot uses contents to inject its children into this grid -->
|
||||||
<ClientOnly showFallback={false}>
|
<ClientOnly showFallback={false}>
|
||||||
{#snippet children()}
|
{#snippet children()}
|
||||||
|
<div class="contents">
|
||||||
<PlayerRoot />
|
<PlayerRoot />
|
||||||
|
</div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</ClientOnly>
|
</ClientOnly>
|
||||||
</aside>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Mobile player UI is rendered via a portal from the single GlobalPlayer instance
|
<!-- Mobile player UI is rendered via a portal from the single GlobalPlayer instance
|
||||||
|
|||||||
Reference in New Issue
Block a user