Pārlūkot izejas kodu

Fixes simulcast on latest Chrome dev (40.0.2214.5).

master
George Politis 11 gadus atpakaļ
vecāks
revīzija
78ef2a9266
1 mainītis faili ar 11 papildinājumiem un 4 dzēšanām
  1. 11
    4
      simulcast.js

+ 11
- 4
simulcast.js Parādīt failu

@@ -55,6 +55,13 @@ SimulcastUtils.prototype._replaceVideoSources = function (lines, videoSources) {
55 55
 
56 56
 };
57 57
 
58
+SimulcastUtils.prototype.isValidDescription = function (desc)
59
+{
60
+    return desc && desc != null
61
+        && desc.type && desc.type != ''
62
+        && desc.sdp && desc.sdp != '';
63
+};
64
+
58 65
 SimulcastUtils.prototype._getVideoSources = function (lines) {
59 66
     var i, inVideo = false, sb = [];
60 67
 
@@ -275,7 +282,7 @@ SimulcastReceiver.prototype._restoreSimulcastGroups = function (sb) {
275 282
 SimulcastReceiver.prototype.reverseTransformRemoteDescription = function (desc) {
276 283
     var sb;
277 284
 
278
-    if (!desc || desc == null) {
285
+    if (!this.simulcastUtils.isValidDescription(desc)) {
279 286
         return desc;
280 287
     }
281 288
 
@@ -664,7 +671,7 @@ NativeSimulcastSender.prototype.getUserMedia = function (constraints, success, e
664 671
 NativeSimulcastSender.prototype.reverseTransformLocalDescription = function (desc) {
665 672
     var sb;
666 673
 
667
-    if (!desc || desc == null || this._isUsingScreenStream) {
674
+    if (!this.simulcastUtils.isValidDescription(desc) || this._isUsingScreenStream) {
668 675
         return desc;
669 676
     }
670 677
 
@@ -692,7 +699,7 @@ NativeSimulcastSender.prototype.reverseTransformLocalDescription = function (des
692 699
  */
693 700
 NativeSimulcastSender.prototype.transformAnswer = function (desc) {
694 701
 
695
-    if (!desc || desc == null || this._isUsingScreenStream) {
702
+    if (!this.simulcastUtils.isValidDescription(desc) || this._isUsingScreenStream) {
696 703
         return desc;
697 704
     }
698 705
 
@@ -893,7 +900,7 @@ SimpleSimulcastSender.prototype.getUserMedia = function (constraints, success, e
893 900
 SimpleSimulcastSender.prototype.reverseTransformLocalDescription = function (desc) {
894 901
     var sb;
895 902
 
896
-    if (!desc || desc == null) {
903
+    if (!this.simulcastUtils.isValidDescription(desc)) {
897 904
         return desc;
898 905
     }
899 906
 

Notiek ielāde…
Atcelt
Saglabāt