From a206f6ef86b25e537909aa63188f6fceba61b9de Mon Sep 17 00:00:00 2001 From: Ivan Pedrazas <ipedrazas@gmail.com> Date: Tue, 5 Nov 2013 23:00:19 +0000 Subject: [PATCH] Fixed the error 'createGainNode is not a function' with Firefox. createGainNode has been replaced with createGain --- js/Runtime.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/Runtime.js b/js/Runtime.js index ec1126f..8a64f22 100644 --- a/js/Runtime.js +++ b/js/Runtime.js @@ -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); };