{#if showTime}
{Duration.fromObject({ seconds: remainingSeconds }).toFormat('m:ss')}
{/if}
{#if enablePlayback} {#if loading}
{:else if error}
{:else}
{/if} {:else}
{/if}
{#if enablePlayback}
{ loading = false; error = false; }} on:error={() => { error = true; loading = false; }} on:timeupdate={({ currentTarget }) => { const remaining = currentTarget.duration - currentTarget.currentTime; remainingSeconds = Math.min(Math.ceil(remaining), durationInSeconds); }} /> {/if}