开发者

cannot play iPad <audio> over https

I am trying to play HTML5 on iPad Safari . Below is my code;

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

Now my audio files are called over ht开发者_Python百科tps and for some reasons, it cannot play audio over https...I mean if I try manually playing mp3 files on http, it plays them fine..

How do I fix this issue?


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

audio/mpeg may be the issue. Safari on iOS (including iPad) currently supports uncompressed WAV and AIF audio, MP3 audio, and AAC-LC or HE-AAC audio. HE-AAC is the preferred format.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜