Reputation: 267
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.
Upvotes: 1
Views: 83
Reputation: 13800
I think you're looking for the canplaythrough event.
audio.addEventListener('canplaythrough', function() {
audio.play();
// code that removes your gif loader
}, false);
Upvotes: 1