瀏覽代碼

Fixes simulcast on latest Chrome dev (40.0.2214.5).

master
George Politis 11 年之前
父節點
當前提交
78ef2a9266
共有 1 個文件被更改,包括 11 次插入4 次删除
  1. 11
    4
      simulcast.js

+ 11
- 4
simulcast.js 查看文件

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
 SimulcastUtils.prototype._getVideoSources = function (lines) {
65
 SimulcastUtils.prototype._getVideoSources = function (lines) {
59
     var i, inVideo = false, sb = [];
66
     var i, inVideo = false, sb = [];
60
 
67
 
275
 SimulcastReceiver.prototype.reverseTransformRemoteDescription = function (desc) {
282
 SimulcastReceiver.prototype.reverseTransformRemoteDescription = function (desc) {
276
     var sb;
283
     var sb;
277
 
284
 
278
-    if (!desc || desc == null) {
285
+    if (!this.simulcastUtils.isValidDescription(desc)) {
279
         return desc;
286
         return desc;
280
     }
287
     }
281
 
288
 
664
 NativeSimulcastSender.prototype.reverseTransformLocalDescription = function (desc) {
671
 NativeSimulcastSender.prototype.reverseTransformLocalDescription = function (desc) {
665
     var sb;
672
     var sb;
666
 
673
 
667
-    if (!desc || desc == null || this._isUsingScreenStream) {
674
+    if (!this.simulcastUtils.isValidDescription(desc) || this._isUsingScreenStream) {
668
         return desc;
675
         return desc;
669
     }
676
     }
670
 
677
 
692
  */
699
  */
693
 NativeSimulcastSender.prototype.transformAnswer = function (desc) {
700
 NativeSimulcastSender.prototype.transformAnswer = function (desc) {
694
 
701
 
695
-    if (!desc || desc == null || this._isUsingScreenStream) {
702
+    if (!this.simulcastUtils.isValidDescription(desc) || this._isUsingScreenStream) {
696
         return desc;
703
         return desc;
697
     }
704
     }
698
 
705
 
893
 SimpleSimulcastSender.prototype.reverseTransformLocalDescription = function (desc) {
900
 SimpleSimulcastSender.prototype.reverseTransformLocalDescription = function (desc) {
894
     var sb;
901
     var sb;
895
 
902
 
896
-    if (!desc || desc == null) {
903
+    if (!this.simulcastUtils.isValidDescription(desc)) {
897
         return desc;
904
         return desc;
898
     }
905
     }
899
 
906
 

Loading…
取消
儲存