Phonegap 5.3.6音频不在kitkat上播放,而是在棒棒糖上播放

时间:2015-11-07 11:46:13

标签: cordova audio phonegap-plugins phonegap-build

我使用Phonegap 5.3.6。

我有一个简单的工作phonegap脚本来播放MP3文件。 它在我的Nexus 4(Lolipop 5.1.1)上运行良好,声音很好。没问题。

但是当我尝试使用华硕Zenfone 5(KitKat 4.4.2)和中文平板电脑(Kitkat 4.4.1)时,脚本可以工作,但声音是静音的。根本不玩。

如何让华硕Zenfone 5和中文平板电脑播放声音?

我的index.html

$(document).ready(function() {
    "use strict";

    var mySounds=[new Audio("sound/click0.mp3"), new Audio("sound/click1.mp3"),  new Audio("sound/test.mp3")];

    $("[id^='playClip']").click(function(e) {
        var arrayIndex = 1;
        alert("OK");
        mySounds[arrayIndex].play();        
    });
});

function sidhi() {
    alert("asafd");
}

my sound.js

cordova-plugin-file 3.0.0 "File"
cordova-plugin-media 1.0.1 "Media"
cordova-plugin-whitelist 1.0.0 "Whitelist"

已安装的插件:

{{1}}

1 个答案:

答案 0 :(得分:2)

我在使用gameapp时遇到了同样的问题.....问题是棒棒糖和kitkat在他们的网页浏览中有一些差异......考虑在你的应用程序中使用CROSSWALK项目.....但这个将您的应用程序大小增加约18mb ......它易于使用。您只需在当前项目中安装插件,然后照常构建项目。

相关问题