修正无法在iPhone上播放声音的bug
This commit is contained in:
parent
3b8b25d2b8
commit
3752318631
@ -195,10 +195,14 @@ window.onload = function(){
|
||||
|
||||
|
||||
}
|
||||
var script_processor=null
|
||||
var audio_ctx = null
|
||||
function initAudioEvent() {
|
||||
var aaa = window.webkitAudioContext || window.AudioContext
|
||||
var audio_ctx = new aaa();
|
||||
var script_processor = audio_ctx.createScriptProcessor(4096, 0, 2);
|
||||
script_processor && (script_processor.disconnect(audio_ctx.destination), script_processor.onaudioprocess = null, script_processor = null)
|
||||
audio_ctx && audio_ctx.close().catch(handleError)
|
||||
window.AudioContext = window.webkitAudioContext || window.AudioContext
|
||||
audio_ctx = new window.AudioContext ();
|
||||
script_processor = audio_ctx.createScriptProcessor(4096, 0, 2);
|
||||
script_processor.onaudioprocess = audio_callback;
|
||||
script_processor.connect(audio_ctx.destination);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user