refact store again

This commit is contained in:
wryk
2020-02-14 16:48:49 +01:00
parent 9b87708077
commit dacc31ce77
6 changed files with 99 additions and 85 deletions

View File

@ -20,20 +20,22 @@
LOADING TRACK
{/if}
{#if duration}
<div>
{currentTimeText}
<input
type="range"
min="0"
max={duration}
value="0"
value="{currentTime}"
on:input={event => updateCurrentTime(event.target.value, false)}
on:change={event => updateCurrentTime(event.target.value, true)}
disabled={currentTime === null || duration === null}
>
{durationText}
{/if}
</div>
</div>
<script>
@ -49,8 +51,8 @@
let duration = null
let seek = null
$: currentTimeText = currentTime !== null ? secondsToElapsedTime(currentTime) : null
$: durationText = duration !== null ? secondsToElapsedTime(duration) : null
$: currentTimeText = currentTime !== null ? secondsToElapsedTime(currentTime) : '--:--'
$: durationText = duration !== null ? secondsToElapsedTime(duration) : '--:--'
$: if (ended || error) {
selectNext()