Merge pull request #33 from ipedrazas/master
Fixed the error 'createGainNode is not a function'
This commit is contained in:
commit
d302a6234c
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);
|
||||
};
|
||||
|
||||
|
|
Reference in a new issue