diff --git a/web/src/routes/artist/[id]/+page.svelte b/web/src/routes/artist/[id]/+page.svelte index e28525e..23fb1d8 100644 --- a/web/src/routes/artist/[id]/+page.svelte +++ b/web/src/routes/artist/[id]/+page.svelte @@ -68,12 +68,16 @@
- {#each artist.shows as show (show.slug)} + {#each artist.shows as show, showIdx (show.slug)}

{show.caption}

- {#each show.sides as side (side.id)} - + {#each show.sides as side, sideIdx (side.id)} + {/each}
diff --git a/web/src/routes/artist/[id]/SidePlayer.svelte b/web/src/routes/artist/[id]/SidePlayer.svelte index ad683e7..f4b3bd4 100644 --- a/web/src/routes/artist/[id]/SidePlayer.svelte +++ b/web/src/routes/artist/[id]/SidePlayer.svelte @@ -2,8 +2,9 @@ type Props = { label: string; src: string; + autoplay?: boolean; }; - let { label, src }: Props = $props(); + let { label, src, autoplay = false }: Props = $props(); let audio: HTMLAudioElement | undefined = $state(); let paused = $state(true); @@ -44,6 +45,11 @@ } } + $effect(() => { + if (!autoplay || !audio) return; + audio.play().catch(() => undefined); + }); + function fmt(s: number) { if (!isFinite(s) || s < 0) return '0:00'; const total = Math.floor(s); @@ -113,7 +119,7 @@ bind:duration onloadstart={() => { errored = false; }} oncanplay={() => { loading = false; }} - onwaiting={() => { loading = true; }} + onwaiting={() => { if (!paused) loading = true; }} onplaying={onPlaying} onerror={() => { loading = false; errored = true; }} onended={() => { paused = true; }}