APlayer icon indicating copy to clipboard operation
APlayer copied to clipboard

InvalidStateError at IE or Edge

Open chenxi-ysc opened this issue 7 years ago • 2 comments

like this: l lc1hlahdhblzdhiohmc8 0b g 3lt vare3y2 r

but when i run at chrome, it works correctly.

chenxi-ysc avatar Oct 24 '18 01:10 chenxi-ysc

Same when i run ap.list.add()

sexym0nk3y avatar Feb 21 '19 10:02 sexym0nk3y

This is caused by calling this.seek(0); in setAudio(audio) method : https://github.com/MoePlayer/APlayer/blob/103f6168770a7fcf380887f9b1291d3d947b1e66/src/js/player.js#L244

A solution would be to move the following code:

this.seek(0);

if (!this.paused) { this.audio.play(); }

inside the canplay event listener.

garniersam avatar May 07 '20 20:05 garniersam