webview中的音频开关按钮,当关闭声音在iOS中播放时

时间:2016-07-04 09:17:35

标签: javascript ios webview

function audioOnOff(){
    if(audio){
        muteAllAudios();
        audio = false;
    }
    else{
        unmuteAllAudios();
        audio = true;
    }
    settingsScreen();

}
function muteAllAudios(){

    correctAnswerSound.muted = true;
    wrongAnswerSound.muted = true;
    boingSound.muted = true;
    wisemanSound.muted = true;
    professorSound.muted = true;
}
function unmuteAllAudios(){

    correctAnswerSound.muted = false;
    wrongAnswerSound.muted = false;
    boingSound.muted = false;
    wisemanSound.muted = false;
    professorSound.muted = false;

我在webView中有一个按钮用于打开/关闭音频设置,但是当我关闭音频时,声音仍会在我的iOS应用程序中播放。解决方案是什么?

0 个答案:

没有答案