我有一个使用html5 <audio>标签在浏览器中播放音频的JavaScript .它在iPhone浏览器中运行良好,但在Android中无效.(使用Android 2.1的htc欲望测试.)任何人都知道为什么?
我的代码:
function playHTML5(sound, soundcv){
// sound = url to m4a audio file
// soundcv = div in which the audioplayer should go
var audio = document.createElement('audio');
audio.src = sound;
audio.controls = "controls";
if (currentSound != null){
soundcv.replaceChild(audio,currentSound);
} else {
soundcv.appendChild(audio);
}
currentSound = audio;
}
Run Code Online (Sandbox Code Playgroud)
顺便说一句,我也试图放大显示在iphone中的音频按钮(默认的一个很小),到目前为止没有运气 - 会对任何想法感激不尽!