InvalidStateError on IE or Edge (#492)
This commit is contained in:
parent
337c242536
commit
1efe60189c
|
|
@ -148,6 +148,14 @@ class APlayer {
|
|||
}
|
||||
});
|
||||
|
||||
// Can seek now
|
||||
this.on('loadedmetadata', () => {
|
||||
this.seek(0);
|
||||
if (!this.paused) {
|
||||
this.audio.play();
|
||||
}
|
||||
});
|
||||
|
||||
// show audio loaded bar: to inform interested parties of progress downloading the media
|
||||
this.on('canplay', () => {
|
||||
const percentage = this.audio.buffered.length ? this.audio.buffered.end(this.audio.buffered.length - 1) / this.duration : 0;
|
||||
|
|
@ -241,11 +249,6 @@ class APlayer {
|
|||
this.audio.src = audio.url;
|
||||
}
|
||||
}
|
||||
this.seek(0);
|
||||
|
||||
if (!this.paused) {
|
||||
this.audio.play();
|
||||
}
|
||||
}
|
||||
|
||||
theme(color = this.list.audios[this.list.index].theme || this.options.theme, index = this.list.index, isReset = true) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue