浏览代码

cleanup: use feature detection for RTX

dev1
Saúl Ibarra Corretgé 8 年前
父节点
当前提交
3ad8d182a2
共有 3 个文件被更改,包括 7 次插入3 次删除
  1. 4
    0
      modules/RTC/RTCBrowserType.js
  2. 2
    2
      modules/RTC/TraceablePeerConnection.js
  3. 1
    1
      modules/xmpp/xmpp.js

+ 4
- 0
modules/RTC/RTCBrowserType.js 查看文件

179
         // whether to actually enable simulcast or not).
179
         // whether to actually enable simulcast or not).
180
         // TODO: the logic should be in one single place.
180
         // TODO: the logic should be in one single place.
181
         return window.chrome !== undefined;
181
         return window.chrome !== undefined;
182
+    },
183
+
184
+    supportsRtx() {
185
+        return !RTCBrowserType.isFirefox();
182
     }
186
     }
183
 
187
 
184
     // Add version getters for other browsers when needed
188
     // Add version getters for other browsers when needed

+ 2
- 2
modules/RTC/TraceablePeerConnection.js 查看文件

930
                         dumpSDP(answer));
930
                         dumpSDP(answer));
931
                 }
931
                 }
932
 
932
 
933
-                if (!this.options.disableRtx && !RTCBrowserType.isFirefox()) {
933
+                if (!this.options.disableRtx && RTCBrowserType.supportsRtx()) {
934
                     answer.sdp = this.rtxModifier.modifyRtxSsrcs(answer.sdp);
934
                     answer.sdp = this.rtxModifier.modifyRtxSsrcs(answer.sdp);
935
                     this.trace(
935
                     this.trace(
936
                         'createAnswerOnSuccess::postTransform (rtx modifier)',
936
                         'createAnswerOnSuccess::postTransform (rtx modifier)',
1028
             groups: []
1028
             groups: []
1029
         };
1029
         };
1030
     }
1030
     }
1031
-    if (!this.options.disableRtx && !RTCBrowserType.isFirefox()) {
1031
+    if (!this.options.disableRtx && RTCBrowserType.supportsRtx()) {
1032
         // Specifically use a for loop here because we'll
1032
         // Specifically use a for loop here because we'll
1033
         //  be adding to the list we're iterating over, so we
1033
         //  be adding to the list we're iterating over, so we
1034
         //  only want to iterate through the items originally
1034
         //  only want to iterate through the items originally

+ 1
- 1
modules/xmpp/xmpp.js 查看文件

82
         this.caps.addFeature('urn:xmpp:jingle:apps:rtp:audio');
82
         this.caps.addFeature('urn:xmpp:jingle:apps:rtp:audio');
83
         this.caps.addFeature('urn:xmpp:jingle:apps:rtp:video');
83
         this.caps.addFeature('urn:xmpp:jingle:apps:rtp:video');
84
 
84
 
85
-        if (!this.options.disableRtx && !RTCBrowserType.isFirefox()) {
85
+        if (!this.options.disableRtx && RTCBrowserType.supportsRtx()) {
86
             this.caps.addFeature('urn:ietf:rfc:4588');
86
             this.caps.addFeature('urn:ietf:rfc:4588');
87
         }
87
         }
88
 
88
 

正在加载...
取消
保存