<audio>无法在使用Android浏览器的https上播放</audio>

时间:2012-11-05 19:39:00

标签: android html5 html5-audio opera-mobile dolphin-browser

因此,我正在维护位于here的存档的主页面,其中插入音频元素,并随机选择RELATIVE链接到音频文件。它在桌面浏览器上播放音频很好,但它无法在Android移动浏览器上播放音频,如Dolphin Jetpack和Opera Mobile。创建音频元素的代码:

var d = document, $ = function(a){ return d.querySelector(a); }, o, a, b
    audios = ["htmlfiles/Log4/Audio Files/1339041384627.png.audio02.ogg",
    "htmlfiles/Log4/Audio Files/1339039129463.png.audio01.ogg",
    "htmlfiles/Log5/Audio Files/s05_08.png.audio01.ogg",
    "htmlfiles/Log6/Audio files/s06_19.png.audio01.ogg",
    "htmlfiles/Log7P1/Audio Files/s07_01.png.audio01.ogg",
    "htmlfiles/Log10/Audio files/1343286991927.png.audio01.ogg",
    "htmlfiles/Log10/Audio files/1343293678793.gif.audio02.ogg",
    "AudioFiles/1343888663849.png.audio02.ogg",
    "AudioFiles/1345719774310.png.audio01.ogg",
    "AudioFiles/1346311163394.png.audio02.ogg",
    "AudioFiles/1346919244950.png.audio02.ogg",
    "AudioFiles/1347509276756.png.audio01.ogg",
    "AudioFiles/1347515470408.png.audio02.ogg",
    "AudioFiles/1348079866537.png.audio01.ogg",
    "AudioFiles/1349419913717.png.audio01.ogg",
    "AudioFiles/1350030423418.png.audio01.ogg",
    "AudioFiles/1350033736151.png.audio02.ogg",
    "AudioFiles/1351231673165.png.audio01.ogg",
    "AudioFiles/1343870457212.png.audio01.ogg"];

/*The code above is in the head tag, the one below is at the end of the body tag*/

window.opera && (o = $('div:not([id])')).parentNode.removeChild(o);
var audio = d.createElement("audio")/*, source = d.createElement("source")*/;
audio.autoplay = audio.controls = audio.loop = true;
// source.type = "audio/ogg";
audio.src =/* source.src =*/ audios[Math.floor(Math.random() * audios.length)];
// audio.appendChild(source);
audio.appendChild(d.createTextNode("Your browser does not support the audio element."));
$("div#container").insertBefore(audio, $("div#container > div:last-of-type").nextElementSibling);

我想知道是什么导致这种行为。我已经在w3schools的试用页面上测试了两种移动浏览器,并且它们的音频在那里工作得很好。我怀疑它可能与https协议有关。

编辑:我已通过报告向导报告了Opera的错误,并通过电子邮件向Mobotap报告了此问题的链接。

1 个答案:

答案 0 :(得分:0)

摆脱这个僵尸。最后,我认为稍后更新浏览器会修复它。