-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Labels
Description
Tracks have to be cached to be able to seek.
I think it "could" be related to race condition between audio.play() and metadata fecthing.
Here's some ideas , maybe :
private async ensureDuration(audio: HTMLAudioElement, retries = 20, delay = 100) {
for (let i = 0; i < retries; i++) {
if (audio.duration && audio.duration !== Infinity && !isNaN(audio.duration)) {
this.ondurationchange(audio.duration)
return
}
await sleep(delay)
}
console.warn('AudioController: failed to resolve duration for', audio.src)
}Reactions are currently unavailable