Fixed the error 'createGainNode is not a function' with Firefox. createGainNode has been replaced with createGain

This commit is contained in:
Ivan Pedrazas 2013-11-05 23:00:19 +00:00
parent 01e38ecfc7
commit a206f6ef86

View file

@ -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);
};