From 78ef2a926629205bd1e28583a5d17ddb95d292dc Mon Sep 17 00:00:00 2001 From: George Politis Date: Thu, 13 Nov 2014 15:00:07 +0100 Subject: [PATCH] Fixes simulcast on latest Chrome dev (40.0.2214.5). --- simulcast.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/simulcast.js b/simulcast.js index ef050f828..55127558b 100644 --- a/simulcast.js +++ b/simulcast.js @@ -55,6 +55,13 @@ SimulcastUtils.prototype._replaceVideoSources = function (lines, videoSources) { }; +SimulcastUtils.prototype.isValidDescription = function (desc) +{ + return desc && desc != null + && desc.type && desc.type != '' + && desc.sdp && desc.sdp != ''; +}; + SimulcastUtils.prototype._getVideoSources = function (lines) { var i, inVideo = false, sb = []; @@ -275,7 +282,7 @@ SimulcastReceiver.prototype._restoreSimulcastGroups = function (sb) { SimulcastReceiver.prototype.reverseTransformRemoteDescription = function (desc) { var sb; - if (!desc || desc == null) { + if (!this.simulcastUtils.isValidDescription(desc)) { return desc; } @@ -664,7 +671,7 @@ NativeSimulcastSender.prototype.getUserMedia = function (constraints, success, e NativeSimulcastSender.prototype.reverseTransformLocalDescription = function (desc) { var sb; - if (!desc || desc == null || this._isUsingScreenStream) { + if (!this.simulcastUtils.isValidDescription(desc) || this._isUsingScreenStream) { return desc; } @@ -692,7 +699,7 @@ NativeSimulcastSender.prototype.reverseTransformLocalDescription = function (des */ NativeSimulcastSender.prototype.transformAnswer = function (desc) { - if (!desc || desc == null || this._isUsingScreenStream) { + if (!this.simulcastUtils.isValidDescription(desc) || this._isUsingScreenStream) { return desc; } @@ -893,7 +900,7 @@ SimpleSimulcastSender.prototype.getUserMedia = function (constraints, success, e SimpleSimulcastSender.prototype.reverseTransformLocalDescription = function (desc) { var sb; - if (!desc || desc == null) { + if (!this.simulcastUtils.isValidDescription(desc)) { return desc; }