From 9ce3b0c0431e8c6490b72ce212ad04aa02af2eed Mon Sep 17 00:00:00 2001 From: Naomi Date: Mon, 27 May 2013 11:55:57 -0400 Subject: [PATCH] small modifications to make the waveform enabled in firefox 21 (playout does not work though) --- airtime_mvc/public/js/waveformplaylist/playout.js | 6 ++---- airtime_mvc/public/js/waveformplaylist/track.js | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/airtime_mvc/public/js/waveformplaylist/playout.js b/airtime_mvc/public/js/waveformplaylist/playout.js index aa8bab9ad..79c5d94c6 100644 --- a/airtime_mvc/public/js/waveformplaylist/playout.js +++ b/airtime_mvc/public/js/waveformplaylist/playout.js @@ -16,8 +16,6 @@ AudioPlayout.prototype.init = function(config) { this.gainNode = undefined; this.destination = this.ac.destination; - this.analyser = this.ac.createAnalyser(); - this.analyser.connect(this.destination); }; AudioPlayout.prototype.getBuffer = function() { @@ -41,7 +39,7 @@ AudioPlayout.prototype.applyFades = function(fades, relPos, now, delay) { duration; this.gainNode && this.gainNode.disconnect(); - this.gainNode = this.ac.createGainNode(); + this.gainNode = this.ac.createGain(); for (id in fades) { @@ -137,7 +135,7 @@ AudioPlayout.prototype.setSource = function(source) { this.source.buffer = this.buffer; this.source.connect(this.gainNode); - this.gainNode.connect(this.analyser); + this.gainNode.connect(this.destination); }; /* diff --git a/airtime_mvc/public/js/waveformplaylist/track.js b/airtime_mvc/public/js/waveformplaylist/track.js index b533f50f9..396989c79 100644 --- a/airtime_mvc/public/js/waveformplaylist/track.js +++ b/airtime_mvc/public/js/waveformplaylist/track.js @@ -176,6 +176,7 @@ TrackEditor.prototype.loadBuffer = function(src) { var that = this, xhr = new XMLHttpRequest(); + xhr.open('GET', src, true); xhr.responseType = 'arraybuffer'; xhr.addEventListener('progress', function(e) { @@ -198,7 +199,6 @@ TrackEditor.prototype.loadBuffer = function(src) { ); }, false); - xhr.open('GET', src, true); xhr.send(); };