mirror of
https://github.com/scratchfoundation/scratch-html5.git
synced 2025-02-26 06:03:52 -05:00
Fixed the error 'createGainNode is not a function' with Firefox. createGainNode has been replaced with createGain
This commit is contained in:
parent
01e38ecfc7
commit
a206f6ef86
1 changed files with 5 additions and 1 deletions
|
@ -42,7 +42,11 @@ Runtime.prototype.init = function() {
|
|||
this.scene = $('#container');
|
||||
window.AudioContext = window.AudioContext || window.webkitAudioContext;
|
||||
this.audioContext = new AudioContext();
|
||||
this.audioGain = this.audioContext.createGainNode();
|
||||
try{
|
||||
this.audioGain = this.audioContext.createGain();
|
||||
}catch(err){
|
||||
this.audioGain = this.audioContext.createGainNode();
|
||||
}
|
||||
this.audioGain.connect(runtime.audioContext.destination);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue