I'm trying to play some audio through the html5 audio tag (using Buzz as a wrapper if that makes any difference).
Because the audio is timed to start with another event, I've been listening for the canplay event.
It works perfectly on Chrome and Firefox, but Safari doesn't trigger the canplay event.
I've added event handlers for all the possible audio events available and as far as I can tell it only fires the loadstart
and loadedmetadata
event.
When the loadedmetadata
is triggered the audio element looks fine in the inspector, but that's where it stops.
I'm guessing that's the cause has something to do with the element set to not auto-play.. for some reason that seems to cause Safari to stop there (if I autoplay then all the events are triggered).
Are you getting the same problem and is there a way to not auto-play the sound but get the canplay event to fire?
My Safari version is 5.1.3 (7534.53.10)
Ok, the work around the problem is simply to set the sound to auto-play and listen to the canplay event. When that triggers I can then pause it and wait for my other event to trigger.
Had to move the logic around a bit but that seems to work ok.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With