diff --git a/MultiStreamsMixer.js b/MultiStreamsMixer.js index 5abb002..414b3c6 100644 --- a/MultiStreamsMixer.js +++ b/MultiStreamsMixer.js @@ -475,9 +475,14 @@ function MultiStreamsMixer(arrayOfMediaStreams, elementClass) { if (stream.getTracks().filter(function(t) { return t.kind === 'audio'; - }).length) { + }).length) { + if (!Storage.AudioContextConstructor) { + Storage.AudioContextConstructor = new Storage.AudioContext(); + } + self.audioContext = Storage.AudioContextConstructor; + var audioSource = self.audioContext.createMediaStreamSource(stream); - // self.audioDestination = self.audioContext.createMediaStreamDestination(); + self.audioDestination = self.audioContext.createMediaStreamDestination(); audioSource.connect(self.audioDestination); newStream.addTrack(self.audioDestination.stream.getTracks().filter(function(t) {