1

I want a gif loader image to disappear as soon as an autoplayed audio tag starts playing ie. after it loads. Is there any way to do this with javascript? The audio is a live stream if that matters.

4

1 回答 1

1

I think you're looking for the canplaythrough event.

audio.addEventListener('canplaythrough', function() { 
    audio.play();
    // code that removes your gif loader
}, false);
于 2012-11-03T19:24:12.660 回答