Fixes simulcast on latest Chrome dev (40.0.2214.5).

This commit is contained in:
George Politis 2014-11-13 15:00:07 +01:00
parent 071c01e644
commit 78ef2a9266
1 changed files with 11 additions and 4 deletions

View File

@ -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) { SimulcastUtils.prototype._getVideoSources = function (lines) {
var i, inVideo = false, sb = []; var i, inVideo = false, sb = [];
@ -275,7 +282,7 @@ SimulcastReceiver.prototype._restoreSimulcastGroups = function (sb) {
SimulcastReceiver.prototype.reverseTransformRemoteDescription = function (desc) { SimulcastReceiver.prototype.reverseTransformRemoteDescription = function (desc) {
var sb; var sb;
if (!desc || desc == null) { if (!this.simulcastUtils.isValidDescription(desc)) {
return desc; return desc;
} }
@ -664,7 +671,7 @@ NativeSimulcastSender.prototype.getUserMedia = function (constraints, success, e
NativeSimulcastSender.prototype.reverseTransformLocalDescription = function (desc) { NativeSimulcastSender.prototype.reverseTransformLocalDescription = function (desc) {
var sb; var sb;
if (!desc || desc == null || this._isUsingScreenStream) { if (!this.simulcastUtils.isValidDescription(desc) || this._isUsingScreenStream) {
return desc; return desc;
} }
@ -692,7 +699,7 @@ NativeSimulcastSender.prototype.reverseTransformLocalDescription = function (des
*/ */
NativeSimulcastSender.prototype.transformAnswer = function (desc) { NativeSimulcastSender.prototype.transformAnswer = function (desc) {
if (!desc || desc == null || this._isUsingScreenStream) { if (!this.simulcastUtils.isValidDescription(desc) || this._isUsingScreenStream) {
return desc; return desc;
} }
@ -893,7 +900,7 @@ SimpleSimulcastSender.prototype.getUserMedia = function (constraints, success, e
SimpleSimulcastSender.prototype.reverseTransformLocalDescription = function (desc) { SimpleSimulcastSender.prototype.reverseTransformLocalDescription = function (desc) {
var sb; var sb;
if (!desc || desc == null) { if (!this.simulcastUtils.isValidDescription(desc)) {
return desc; return desc;
} }