javascript - how to check audio tag load file complete -
i play audio file using audio tag in html 5 duration of file 20 second. when open page, duration of audio tag 14 second. refresh page. can see duration change 14 sec or 20 sec. don't know why. , when file not loaded completely, can't control player. click play bar, not control
in other case, file load completely, can control currenttime , play(). file not loaded completely, can use play file 1 time, not control it
how sure file load always?
you may check using 'onloadeddata', add listener
<audio onloadeddata="dothisonload()"> </audio>
Comments
Post a Comment