[]webaudio 在iframe中使用, android chrome中没声音

在android chrome上,直接在192.168.188.253:8080/index.html访问是可以播放webaudio的,但是通过iframe src="192.168.188.253:8080/index.html"却不行。经过搜索,是chrome禁止iframe中的跨域webaudio自动播放。参考Block Web Audio autoplay on cross origin iframes https://bugs.chromium.org/p/ch ... 14115
 
为了解决这个问题,我又参考了https://github.com/photonstorm/phaser/issues/2913
在引擎WebAudioSound源码中添加了几行,解决了问题。官方要不要修复一下这个BUG?

WebAudioSound._playEmptySound=function(){
    if (WebAudioSound.ctx==null){
        return;
    };
    var source=WebAudioSound.ctx.createBufferSource();
    source.buffer=WebAudioSound._miniBuffer;
    source.connect(WebAudioSound.ctx.destination);
    source.start(0,0,0);
    //Hello Chrome 55!
    if (source.context.state === 'suspended') {
        source.context.resume();
    }
}
已邀请:

ymsdandan

赞同来自:

我们正在对各个浏览器进行测试,到时候会汇总出一个表格,请留心论坛的更新

要回复问题请先

商务合作
商务合作