Fix audio load
This commit is contained in:
parent
c74c63ebd7
commit
a40e4d2211
1 changed files with 3 additions and 2 deletions
|
|
@ -19,6 +19,7 @@
|
|||
}
|
||||
if (!audio) return;
|
||||
if (audio.paused) {
|
||||
if (audio.readyState < 3) loading = true;
|
||||
audio.play().catch(() => undefined);
|
||||
} else {
|
||||
audio.pause();
|
||||
|
|
@ -95,7 +96,7 @@
|
|||
<input
|
||||
type="range"
|
||||
min="0"
|
||||
max={duration && isFinite(duration) ? duration : 0}
|
||||
max={duration && isFinite(duration) ? duration : 1}
|
||||
step="0.1"
|
||||
bind:value={currentTime}
|
||||
disabled={!duration || !isFinite(duration)}
|
||||
|
|
@ -110,7 +111,7 @@
|
|||
bind:paused
|
||||
bind:currentTime
|
||||
bind:duration
|
||||
onloadstart={() => { loading = true; errored = false; }}
|
||||
onloadstart={() => { errored = false; }}
|
||||
oncanplay={() => { loading = false; }}
|
||||
onwaiting={() => { loading = true; }}
|
||||
onplaying={onPlaying}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue