I am working with html5 audio and am encountering some buffer problems. This works fine in Chrome, but there is noticeable latency in Safari (and SafMob). The idea is simple. The user clicks the img link, and img "jumps" and makes a sound. Here is an example .
Is there a way to preload the audio file so that it works faster? Again, my main problem is the Safari / Safari Mobile browser.
In jQuery, I use:
$("#bell a").click(function() {
var snd = new Audio("ping.mp3");
snd.play();
$(this).stop().animate({ marginTop: "-10px" }, 200).animate({ marginTop: "18px" }, 200).animate({ marginTop: "1px" }, 300);
return false;
});
This is the button code:
<ul id="bell">
<li class="button"><a href="#" title="Pling">Link Text</a></li>
</ul>
source
share