Pārlūkot izejas kodu

feat(RTC) bump minimum supported Chromium version to 72

Cleanup some unused code after the bump.
tags/v0.0.2
Saúl Ibarra Corretgé 5 gadus atpakaļ
vecāks
revīzija
0579afc885
2 mainītis faili ar 11 papildinājumiem un 98 dzēšanām
  1. 3
    81
      modules/RTC/RTCUtils.js
  2. 8
    17
      modules/browser/BrowserCapabilities.js

+ 3
- 81
modules/RTC/RTCUtils.js Parādīt failu

@@ -755,56 +755,6 @@ function handleLocalStream(streams, resolution) {
755 755
     return res;
756 756
 }
757 757
 
758
-/**
759
- * Represents a default implementation of setting a <tt>MediaStream</tt> as the
760
- * source of a video element that tries to be browser-agnostic through feature
761
- * checking. Note though that it was not completely clear from the predating
762
- * browser-specific implementations what &quot;videoSrc&quot; was because one
763
- * implementation of {@link RTCUtils#getVideoSrc} would return
764
- * <tt>MediaStream</tt> (e.g. Firefox), another a <tt>string</tt> representation
765
- * of the <tt>URL</tt> of the <tt>MediaStream</tt> (e.g. Chrome) and the return
766
- * value was only used by {@link RTCUIHelper#getVideoId} which itself did not
767
- * appear to be used anywhere. Generally, the implementation will try to follow
768
- * the related standards i.e. work with the <tt>srcObject</tt> and <tt>src</tt>
769
- * properties of the specified <tt>element</tt> taking into account vender
770
- * prefixes.
771
- *
772
- * @param element the element whose video source/src is to be set to the
773
- * specified <tt>stream</tt>
774
- * @param {MediaStream} stream the <tt>MediaStream</tt> to set as the video
775
- * source/src of <tt>element</tt>
776
- */
777
-function defaultSetVideoSrc(element, stream) {
778
-    // srcObject
779
-    let srcObjectPropertyName = 'srcObject';
780
-
781
-    if (!(srcObjectPropertyName in element)) {
782
-        srcObjectPropertyName = 'mozSrcObject';
783
-        if (!(srcObjectPropertyName in element)) {
784
-            srcObjectPropertyName = null;
785
-        }
786
-    }
787
-    if (srcObjectPropertyName) {
788
-        element[srcObjectPropertyName] = stream;
789
-
790
-        return;
791
-    }
792
-
793
-    // src
794
-    let src;
795
-
796
-    if (stream) {
797
-        src = stream.jitsiObjectURL;
798
-
799
-        // Save the created URL for stream so we can reuse it and not keep
800
-        // creating URLs.
801
-        if (!src) {
802
-            stream.jitsiObjectURL = src = URL.createObjectURL(stream);
803
-        }
804
-    }
805
-    element.src = src || '';
806
-}
807
-
808 758
 /**
809 759
  *
810 760
  */
@@ -865,22 +815,13 @@ class RTCUtils extends Listenable {
865 815
 
866 816
             this.getStreamID = ({ id }) => id;
867 817
             this.getTrackID = ({ id }) => id;
868
-        } else if (browser.isChromiumBased() // this is chrome < 61
869
-                || browser.isReactNative()) {
870
-
818
+        } else if (browser.isReactNative()) {
871 819
             this.RTCPeerConnectionType = RTCPeerConnection;
872 820
 
873
-            this.attachMediaStream
874
-                = wrapAttachMediaStream((element, stream) => {
875
-                    defaultSetVideoSrc(element, stream);
876
-
877
-                    return element;
878
-                });
821
+            this.attachMediaStream = undefined; // Unused on React Native.
879 822
 
880 823
             this.getStreamID = function({ id }) {
881
-                // A. MediaStreams from FF endpoints have the characters '{' and
882
-                // '}' that make jQuery choke.
883
-                // B. The react-native-webrtc implementation that we use at the
824
+                // The react-native-webrtc implementation that we use at the
884 825
                 // time of this writing returns a number for the id of
885 826
                 // MediaStream. Let's just say that a number contains no special
886 827
                 // characters.
@@ -890,17 +831,6 @@ class RTCUtils extends Listenable {
890 831
                         : SDPUtil.filterSpecialChars(id));
891 832
             };
892 833
             this.getTrackID = ({ id }) => id;
893
-
894
-            if (!MediaStream.prototype.getVideoTracks) {
895
-                MediaStream.prototype.getVideoTracks = function() {
896
-                    return this.videoTracks;
897
-                };
898
-            }
899
-            if (!MediaStream.prototype.getAudioTracks) {
900
-                MediaStream.prototype.getAudioTracks = function() {
901
-                    return this.audioTracks;
902
-                };
903
-            }
904 834
         } else {
905 835
             const message = 'Endpoint does not appear to be WebRTC-capable';
906 836
 
@@ -1492,14 +1422,6 @@ class RTCUtils extends Listenable {
1492 1422
         if (mediaStream.release) {
1493 1423
             mediaStream.release();
1494 1424
         }
1495
-
1496
-        // if we have done createObjectURL, lets clean it
1497
-        const url = mediaStream.jitsiObjectURL;
1498
-
1499
-        if (url) {
1500
-            delete mediaStream.jitsiObjectURL;
1501
-            URL.revokeObjectURL(url);
1502
-        }
1503 1425
     }
1504 1426
 
1505 1427
     /**

+ 8
- 17
modules/browser/BrowserCapabilities.js Parādīt failu

@@ -3,6 +3,9 @@ import { getLogger } from 'jitsi-meet-logger';
3 3
 
4 4
 const logger = getLogger(__filename);
5 5
 
6
+/* Minimum required Chrome / Chromium version. This applies also to derivatives. */
7
+const MIN_REQUIRED_CHROME_VERSION = 72;
8
+
6 9
 // TODO: Move this code to js-utils.
7 10
 
8 11
 // NOTE: Now we are extending BrowserDetection in order to preserve
@@ -76,7 +79,7 @@ export default class BrowserCapabilities extends BrowserDetection {
76 79
      * @returns {boolean} true if the browser is supported, false otherwise.
77 80
      */
78 81
     isSupported() {
79
-        return this.isChromiumBased()
82
+        return (this.isChromiumBased() && this._getChromiumBasedVersion() >= MIN_REQUIRED_CHROME_VERSION)
80 83
             || this.isFirefox()
81 84
             || this.isReactNative()
82 85
             || (this.isSafari() && !this.isVersionLessThan('12.1'));
@@ -220,11 +223,9 @@ export default class BrowserCapabilities extends BrowserDetection {
220 223
         }
221 224
 
222 225
         if (this.isSafari() && typeof window.RTCRtpTransceiver !== 'undefined') {
223
-            // eslint-disable-next-line max-len
224 226
             // https://trac.webkit.org/changeset/236144/webkit/trunk/LayoutTests/webrtc/video-addLegacyTransceiver.html
225 227
             // eslint-disable-next-line no-undef
226
-            return Object.keys(RTCRtpTransceiver.prototype)
227
-                   .indexOf('currentDirection') > -1;
228
+            return Object.keys(RTCRtpTransceiver.prototype).indexOf('currentDirection') > -1;
228 229
         }
229 230
 
230 231
         return false;
@@ -239,26 +240,16 @@ export default class BrowserCapabilities extends BrowserDetection {
239 240
      * @returns {boolean}
240 241
      */
241 242
     usesNewGumFlow() {
242
-        const REQUIRED_CHROME_VERSION = 61;
243
-
244
-        if (this.isChrome()) {
245
-            return !this.isVersionLessThan(REQUIRED_CHROME_VERSION);
246
-        }
247
-
248
-        if (this.isFirefox() || this.isSafari()) {
243
+        if (this.isChromiumBased() || this.isFirefox() || this.isSafari()) {
249 244
             return true;
250 245
         }
251 246
 
252
-        if (this.isChromiumBased()) {
253
-            return this._getChromiumBasedVersion() >= REQUIRED_CHROME_VERSION;
254
-        }
255
-
256 247
         return false;
257 248
     }
258 249
 
259 250
     /**
260 251
      * Checks if the browser uses webrtc-adapter. All browsers using the new
261
-     * getUserMedia flow and Edge.
252
+     * getUserMedia flow.
262 253
      *
263 254
      * @returns {boolean}
264 255
      */
@@ -328,7 +319,7 @@ export default class BrowserCapabilities extends BrowserDetection {
328 319
      * @returns {boolean}
329 320
      */
330 321
     supportsSdpSemantics() {
331
-        return this.isChromiumBased() && this._getChromiumBasedVersion() >= 65;
322
+        return this.isChromiumBased();
332 323
     }
333 324
 
334 325
     /**

Notiek ielāde…
Atcelt
Saglabāt