0

I want to preload two sound-files and play them on user event.

Trying to do

<audio id="ok" src="ok.mp3"></audio>
<audio id="bad" src="bad.mp3"></audio>

and later

document.getElementById("ok").play();

This works only with one file, not two!?

Tried also

var au = new Audio('ok.mp3');
au.play();

without sucess.

All i dandy in windows / chrome but nothing on the iPod.

Thankful for any cross-browser insight in the matter. (html5).

regards,

Teson
  • 6,644
  • 8
  • 46
  • 69
  • Ok, The problem is not two audio files, but the usage - the second file should autoplay, iOS doesn't allow this. :-|, http://stackoverflow.com/questions/3009888/autoplay-audio-files-on-an-ipad-with-html5 – Teson Apr 18 '12 at 08:13

1 Answers1

1

Apple doesn't allow autoplaying. You need listen for some user input, e.g. on button click event and there play a file.

Andron
  • 6,413
  • 4
  • 43
  • 56