我有一個使用html5 <audio>
標記在瀏覽器中播放音頻的javascript。它在iPhone瀏覽器中正常工作,但不適用於Android。 (使用android 2.1的htc願望進行測試。)任何人都知道爲什麼?在Android瀏覽器中播放html5音頻
我的代碼:
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;
}
順便說一句,我也試圖放大音頻按鈕,在iPhone(默認一個相當小)顯示出來,沒有運氣迄今爲止 - 會感激任何想法!
佩卡:謝謝固定的格式!沒有注意到我搞砸了。 – 2010-06-18 12:57:13