I have to play very short sounds on UI events (pressing a button, showing a popup) in my iOS web-app. I do it the following way:
// Standard HTML5 implementation of PlaySound.
function Html5PlaySound(sound)
{
var player = document.getElementById('soundPlayer');
player.pause();
player.setAttribute('src', 'sound/' + sound + '.mp3');
player.play();
}
Unfortunately, it's being reloaded every time (I see 'waiting circle' in the title bar). Is it possible to force somehow iPhone to cache the sounds and not reload them every time?
Regards,