|
@@ -108,7 +108,7 @@ Manage.prototype.loadWeixin = function() {
|
|
|
Manage.prototype.loadAudio = function() { //相关:g_tourAudio \ g_playAudio
|
|
|
g_bgAudio = new Audio;
|
|
|
g_bgAudio.loop = true;
|
|
|
- g_bgAudio.autoplay = true;
|
|
|
+ g_bgAudio.autoplay = false;
|
|
|
g_bgAudio.id = "bgaudio";
|
|
|
|
|
|
//https://www.cnblogs.com/interdrp/p/4211883.html 部分资料
|
|
@@ -116,7 +116,7 @@ Manage.prototype.loadAudio = function() { //相关:g_tourAudio \ g_playAudio
|
|
|
var play = function(){
|
|
|
//if(window.tourAudioSta) return;
|
|
|
|
|
|
- this.switchBgmState(true)
|
|
|
+ // this.switchBgmState(true)
|
|
|
|
|
|
document.removeEventListener("touchstart",play);
|
|
|
document.removeEventListener("click",play);
|
|
@@ -124,10 +124,10 @@ Manage.prototype.loadAudio = function() { //相关:g_tourAudio \ g_playAudio
|
|
|
}.bind(this);
|
|
|
|
|
|
g_bgAudio.oncanplay = ()=>{
|
|
|
- this.switchBgmState(true)
|
|
|
+ // this.switchBgmState(true)
|
|
|
}
|
|
|
document.addEventListener("WeixinJSBridgeReady", ()=> {
|
|
|
- this.switchBgmState(true)
|
|
|
+ // this.switchBgmState(true)
|
|
|
}, false);
|
|
|
|
|
|
document.addEventListener("touchstart", play);//ios需要加个事件才能播放 不能自动播放;如果还有浏览器不行,换成别的交互事件
|