{ started = true; failed = false; session(); wake(); }} onwaiting={() => (waiting = true)} onplaying={() => (waiting = false)} oncanplay={() => (waiting = false)} onerror={() => (failed = true)} > {@render children?.()}
{#if message}
{message}
{:else if waiting}
{:else if !started}
{ toggle(); // The button goes once it plays: keep keyboard focus on the player, not the page. wrap.focus({ preventScroll: true }); }} >
{/if}
seek(+e.currentTarget.value)} onkeydown={scrubKeys} />
(muted = !muted)} >
{ volume = +e.currentTarget.value; muted = volume === 0; }} />
{clock(time)}
/
{clock(duration)}
{@render controls?.()}
{#snippet trigger(props)}
{/snippet} {#each rates as r (r)}
(speed = r)}>
{#if r === speed}
{/if}
{r === 1 ? 'Normal' : `${rate.format(r)}×`}
{/each}
{#if hasCaptions}
setCaptions(!captions)} >
{/if} {#if canPip}
{/if}