Unable to play html5 audio on ipad safari

I cannot play html5 audio on Safari iPad .. I tried

var audio = document.createElement('audio');
    audio.type = "audio/mpeg";
    audio.src = audioUrl;         
    x.appendChild(audio);
audio.load()
    audio.play();

and

x.innerHTML = '<audio autoplay=autoplay><source src="'+audioUrl + '" type=audio/mpeg /></audio>';

I can play on the Safari desktop, but on the iPad it says it cannot play a movie ...

I am using ios 4.3

One important thing that I might think I need to look at is to add the mime type to htaccess. Although Iโ€™m not sure how and if this is a problem ... But just to add, I can play backup mp3 using embed older browsers .. also means that even html5 sound should work without the need to add a MIME type?

Please help me. Thank,..

+3
source share
1 answer

- (, , , mp3 ), .htaccess, MPEG . .htaccess (- )

AddType audio/mpeg .mp3

, !

+1

All Articles