From 84391f5a8f663113fd8400e3562bf38be367b809 Mon Sep 17 00:00:00 2001 From: Simon Eisenmann Date: Sat, 25 Apr 2015 19:19:12 +0200 Subject: [PATCH] Never try to add a stream without audiotrack to audio processor. --- static/js/mediastream/usermedia.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/static/js/mediastream/usermedia.js b/static/js/mediastream/usermedia.js index fb6d3de8..285fecff 100644 --- a/static/js/mediastream/usermedia.js +++ b/static/js/mediastream/usermedia.js @@ -167,6 +167,11 @@ define(['jquery', 'underscore', 'audiocontext', 'webrtc.adapter'], function($, _ if (this.audioSource) { this.audioSource.disconnect(); } + var audioTracks = stream.getAudioTracks(); + if (audioTracks.length < 1) { + this.audioSource = null; + return; + } // Connect to audioProcessor. this.audioSource = context.createMediaStreamSource(stream); //console.log("got source", this.audioSource);