问题
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,
回答1:
i am using html5 manifest for caching stuff its working fine, however it seems the sounds only cache after i play them at least once in safari. (if i play them in safari and on webapp, go to airplane mode, it works)
you might be interessted in this thread Offline iOS web app: loads my manifest, but doesn't work offline
来源:https://stackoverflow.com/questions/11094414/caching-sounds-on-mobile-safari