{#if enablePlayback} { loading = false; error = false; }} onerror={() => { if (!player?.src) { // Do not show error when the URL is empty. return; } error = true; loading = false; }} ontimeupdate={({ currentTarget }) => { const remaining = currentTarget.duration - currentTarget.currentTime; remainingSeconds = Math.min( Math.ceil(Number.isNaN(remaining) ? Number.POSITIVE_INFINITY : remaining), durationInSeconds, ); }} > {/if}