Просмотр исходного кода

fix(RTCBrowserType): remove duplication

There was 'supportsSimulcast' method already, so removing
'isSimulcastSupported'.
tags/v0.0.2
paweldomas 8 лет назад
Родитель
Сommit
4fbb1e1098
2 измененных файлов: 4 добавлений и 16 удалений
  1. 3
    15
      modules/RTC/RTCBrowserType.js
  2. 1
    1
      modules/RTC/TraceablePeerConnection.js

+ 3
- 15
modules/RTC/RTCBrowserType.js Просмотреть файл

@@ -107,17 +107,6 @@ const RTCBrowserType = {
107 107
         return currentBrowser === RTCBrowserType.RTC_BROWSER_SAFARI;
108 108
     },
109 109
 
110
-    /**
111
-     * Checks if the current client supports Simulcast.
112
-     * @return {boolean} <tt>true</tt> if Simulcast is supported or
113
-     * <tt>false</tt> otherwise.
114
-     */
115
-    isSimulcastSupported() {
116
-        // Possibly it could work with anything that uses "official" WebRTC
117
-        // stack, but only Chrome was tested.
118
-        return RTCBrowserType.isChrome();
119
-    },
120
-
121 110
     /**
122 111
      * Checks if current environment is NWJS.
123 112
      * @returns {boolean}
@@ -223,10 +212,9 @@ const RTCBrowserType = {
223 212
      * @returns {boolean}
224 213
      */
225 214
     supportsSimulcast() {
226
-        // This mirrors what sdp-simulcast uses (which is used when deciding
227
-        // whether to actually enable simulcast or not).
228
-        // TODO: the logic should be in one single place.
229
-        return window.chrome !== undefined;
215
+        return RTCBrowserType.isChrome()
216
+            || RTCBrowserType.isElectron()
217
+            || RTCBrowserType.isNWJS();
230 218
     },
231 219
 
232 220
     supportsRtx() {

+ 1
- 1
modules/RTC/TraceablePeerConnection.js Просмотреть файл

@@ -356,7 +356,7 @@ TraceablePeerConnection.prototype._getDesiredMediaDirection
356 356
  */
357 357
 TraceablePeerConnection.prototype.isSimulcastOn = function() {
358 358
     return !this.options.disableSimulcast
359
-        && RTCBrowserType.isSimulcastSupported()
359
+        && RTCBrowserType.supportsSimulcast()
360 360
         && !this.isP2P;
361 361
 };
362 362
 

Загрузка…
Отмена
Сохранить