Ver código fonte

feat(sanity): axe IE and Temasys plugin support 🔥🔥🔥

master
Saúl Ibarra Corretgé 6 anos atrás
pai
commit
826dacdc7d

+ 0
- 1
.eslintignore Ver arquivo

@@ -8,7 +8,6 @@ lib-jitsi-meet.min.map
8 8
 # modify as little as possible.
9 9
 doc/example/libs/*
10 10
 flow-typed/*
11
-modules/RTC/adapter.screenshare.js
12 11
 
13 12
 # ESLint will by default ignore its own configuration file. However, there does
14 13
 # not seem to be a reason why we will want to risk being inconsistent with our

+ 1
- 1
JitsiMediaDevicesEvents.js Ver arquivo

@@ -17,7 +17,7 @@ export const DEVICE_LIST_CHANGED = 'mediaDevices.devicechange';
17 17
  * access camera and/or microphone. The event provides the following
18 18
  * parameters to its listeners:
19 19
  *
20
- * @param {'chrome'|'opera'|'firefox'|'iexplorer'|'safari'|'nwjs'
20
+ * @param {'chrome'|'opera'|'firefox'|'safari'|'nwjs'
21 21
  *  |'react-native'|'android'} environmentType - type of browser or
22 22
  *  other execution environment.
23 23
  */

+ 0
- 2
JitsiMeetJS.js Ver arquivo

@@ -24,7 +24,6 @@ import { ParticipantConnectionStatus }
24 24
     from './modules/connectivity/ParticipantConnectionStatus';
25 25
 import RTC from './modules/RTC/RTC';
26 26
 import browser from './modules/browser';
27
-import RTCUIHelper from './modules/RTC/RTCUIHelper';
28 27
 import ScriptUtil from './modules/util/ScriptUtil';
29 28
 import recordingConstants from './modules/recording/recordingConstants';
30 29
 import Statistics from './modules/statistics/statistics';
@@ -539,7 +538,6 @@ export default _mergeNamespaceAndModule({
539 538
      */
540 539
     util: {
541 540
         AuthUtil,
542
-        RTCUIHelper,
543 541
         ScriptUtil,
544 542
         browser
545 543
     }

+ 1
- 1
doc/API.md Ver arquivo

@@ -138,7 +138,7 @@ JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
138 138
 
139 139
     4. mediaDevices
140 140
         - DEVICE_LIST_CHANGED - indicates that list of currently connected devices has changed (parameters - devices(MediaDeviceInfo[])).
141
-        - PERMISSION_PROMPT_IS_SHOWN - Indicates that the environment is currently showing permission prompt to access camera and/or microphone (parameters - environmentType ('chrome'|'opera'|'firefox'|'iexplorer'|'safari'|'nwjs'|'react-native'|'android').
141
+        - PERMISSION_PROMPT_IS_SHOWN - Indicates that the environment is currently showing permission prompt to access camera and/or microphone (parameters - environmentType ('chrome'|'opera'|'firefox'|'safari'|'nwjs'|'react-native'|'android').
142 142
 
143 143
 
144 144
 * ```JitsiMeetJS.errors``` - JS object that contains all errors used by the API. You can use that object to check the reported errors from the API

+ 0
- 3
modules/RTC/JitsiLocalTrack.js Ver arquivo

@@ -265,9 +265,6 @@ export default class JitsiLocalTrack extends JitsiTrack {
265 265
      */
266 266
     _setRealDeviceIdFromDeviceList(devices) {
267 267
         const track = this.getTrack();
268
-
269
-        // FIXME for temasys video track, label refers to id not the actual
270
-        // device
271 268
         const device = devices.find(
272 269
             d => d.kind === `${track.kind}input` && d.label === track.label);
273 270
 

+ 4
- 36
modules/RTC/JitsiRemoteTrack.js Ver arquivo

@@ -1,7 +1,6 @@
1 1
 import { createTtfmEvent } from '../../service/statistics/AnalyticsEvents';
2 2
 import JitsiTrack from './JitsiTrack';
3 3
 import * as JitsiTrackEvents from '../../JitsiTrackEvents';
4
-import browser from '../browser';
5 4
 import Statistics from '../statistics/statistics';
6 5
 
7 6
 const logger = require('jitsi-meet-logger').getLogger(__filename);
@@ -83,24 +82,8 @@ export default class JitsiRemoteTrack extends JitsiTrack {
83 82
      * @returns {void}
84 83
      */
85 84
     _bindMuteHandlers() {
86
-        // Use feature detection for finding what event handling function is
87
-        // supported. On Internet Explorer, which uses uses temasys/firebreath,
88
-        // the track will have attachEvent instead of addEventListener.
89
-        //
90
-        // FIXME it would be better to use recently added '_setHandler' method,
91
-        // but:
92
-        // 1. It does not allow to set more than one handler to the event
93
-        // 2. It does mix MediaStream('inactive') with MediaStreamTrack events
94
-        // 3. Allowing to bind more than one event handler requires too much
95
-        //    refactoring around camera issues detection.
96
-        if (this.track.addEventListener) {
97
-            this.track.addEventListener('mute', () => this._onTrackMute());
98
-            this.track.addEventListener('unmute', () => this._onTrackUnmute());
99
-        } else if (this.track.attachEvent) {
100
-            // FIXME Internet Explorer is not emitting out mute/unmute events.
101
-            this.track.attachEvent('onmute', () => this._onTrackMute());
102
-            this.track.attachEvent('onunmute', () => this._onTrackUnmute());
103
-        }
85
+        this.track.addEventListener('mute', () => this._onTrackMute());
86
+        this.track.addEventListener('unmute', () => this._onTrackUnmute());
104 87
     }
105 88
 
106 89
     /**
@@ -246,8 +229,7 @@ export default class JitsiRemoteTrack extends JitsiTrack {
246 229
      * Attach time to first media tracker only if there is conference and only
247 230
      * for the first element.
248 231
      * @param container the HTML container which can be 'video' or 'audio'
249
-     * element. It can also be 'object' element if Temasys plugin is in use and
250
-     * this method has been called previously on video or audio HTML element.
232
+     * element.
251 233
      * @private
252 234
      */
253 235
     _attachTTFMTracker(container) {
@@ -263,21 +245,7 @@ export default class JitsiRemoteTrack extends JitsiTrack {
263 245
             ttfmTrackerVideoAttached = true;
264 246
         }
265 247
 
266
-        if (browser.isTemasysPluginUsed()) {
267
-            // XXX Don't require Temasys unless it's to be used because it
268
-            // doesn't run on React Native, for example.
269
-            const AdapterJS = require('./adapter.screenshare');
270
-
271
-            // FIXME: this is not working for IE11
272
-            AdapterJS.addEvent(
273
-                container,
274
-                'play',
275
-                this._playCallback.bind(this));
276
-        } else {
277
-            container.addEventListener(
278
-                'canplay',
279
-                this._playCallback.bind(this));
280
-        }
248
+        container.addEventListener('canplay', this._playCallback.bind(this));
281 249
     }
282 250
 
283 251
     /**

+ 9
- 27
modules/RTC/JitsiTrack.js Ver arquivo

@@ -22,12 +22,7 @@ const trackHandler2Prop = {
22 22
  * @param handler the handler
23 23
  */
24 24
 function addMediaStreamInactiveHandler(mediaStream, handler) {
25
-    // Temasys will use onended
26
-    if (typeof mediaStream.active === 'undefined') {
27
-        mediaStream.onended = handler;
28
-    } else {
29
-        mediaStream.oninactive = handler;
30
-    }
25
+    mediaStream.oninactive = handler;
31 26
 }
32 27
 
33 28
 /**
@@ -272,31 +267,20 @@ export default class JitsiTrack extends EventEmitter {
272 267
     /**
273 268
      * Attaches the MediaStream of this track to an HTML container.
274 269
      * Adds the container to the list of containers that are displaying the
275
-     * track. Note that Temasys plugin will replace original audio/video element
276
-     * with 'object' when stream is being attached to the container for the
277
-     * first time.
278
-     * * NOTE * if given container element is not visible when the stream is
279
-     * being attached it will be shown back given that Temasys plugin is
280
-     * currently in use.
270
+     * track.
281 271
      *
282 272
      * @param container the HTML container which can be 'video' or 'audio'
283
-     * element. It can also be 'object' element if Temasys plugin is in use and
284
-     * this method has been called previously on video or audio HTML element.
273
+     * element.
285 274
      *
286
-     * @returns potentially new instance of container if it was replaced by the
287
-     *          library. That's the case when Temasys plugin is in use.
275
+     * @returns {void}
288 276
      */
289 277
     attach(container) {
290
-        let c = container;
291
-
292 278
         if (this.stream) {
293
-            c = RTCUtils.attachMediaStream(container, this.stream);
279
+            RTCUtils.attachMediaStream(container, this.stream);
294 280
         }
295
-        this.containers.push(c);
296
-        this._maybeFireTrackAttached(c);
297
-        this._attachTTFMTracker(c);
298
-
299
-        return c;
281
+        this.containers.push(container);
282
+        this._maybeFireTrackAttached(container);
283
+        this._attachTTFMTracker(container);
300 284
     }
301 285
 
302 286
     /**
@@ -329,9 +313,7 @@ export default class JitsiTrack extends EventEmitter {
329 313
      * for the first element.
330 314
      *
331 315
      * @param {HTMLElement} container the HTML container which can be 'video' or
332
-     * 'audio' element. It can also be 'object' element if Temasys plugin is in
333
-     * use and this method has been called previously on video or audio HTML
334
-     * element.
316
+     * 'audio' element.
335 317
      * @private
336 318
      */
337 319
     _attachTTFMTracker(container) { // eslint-disable-line no-unused-vars

+ 0
- 82
modules/RTC/RTCUIHelper.js Ver arquivo

@@ -1,82 +0,0 @@
1
-/* global $ */
2
-
3
-import browser from '../browser';
4
-
5
-const logger = require('jitsi-meet-logger').getLogger(__filename);
6
-
7
-const RTCUIHelper = {
8
-
9
-    /**
10
-     * Returns the name of 'video' element depending on the browser that we're
11
-     * currently using.
12
-     * @returns {string} 'video' or 'object' string name of WebRTC video element
13
-     */
14
-    getVideoElementName() {
15
-        return browser.isTemasysPluginUsed() ? 'object' : 'video';
16
-    },
17
-
18
-    /**
19
-     * Finds video element inside of the given container.
20
-     * @param containerElement HTML element node instance which is supposed to
21
-     *        contain the video element.
22
-     * @returns {HTMLElement} video HTML element instance if found inside of the
23
-     *          container or undefined otherwise.
24
-     */
25
-    findVideoElement(containerElement) {
26
-        const videoElemName = RTCUIHelper.getVideoElementName();
27
-
28
-        if (!browser.isTemasysPluginUsed()) {
29
-            return $(containerElement).find(videoElemName)[0];
30
-        }
31
-        const matching
32
-            = $(containerElement).find(
33
-                ` ${videoElemName}>param[value="video"]`);
34
-
35
-        if (matching.length) {
36
-            if (matching.length > 1) {
37
-                logger.warn(
38
-                    'Container with more than one video elements: ',
39
-                    containerElement);
40
-            }
41
-
42
-            return matching.parent()[0];
43
-        }
44
-
45
-        return undefined;
46
-    },
47
-
48
-    /**
49
-     * Returns whether or not the video element fires resize events.
50
-     *
51
-     * @returns {boolean}
52
-     */
53
-    isResizeEventSupported() {
54
-        return !browser.isTemasysPluginUsed();
55
-    },
56
-
57
-    /**
58
-     * Sets 'volume' property of given HTML element displaying RTC audio or
59
-     * video stream.
60
-     * @param streamElement HTML element to which the RTC stream is attached to.
61
-     * @param volume the volume value to be set.
62
-     */
63
-    setVolume(streamElement, volume) {
64
-        if (!browser.isIExplorer()) {
65
-            streamElement.volume = volume;
66
-        }
67
-    },
68
-
69
-    /**
70
-     * Sets 'autoplay' property of given HTML element displaying RTC audio or
71
-     * video stream.
72
-     * @param streamElement HTML element to which the RTC stream is attached to.
73
-     * @param autoPlay 'true' or 'false'
74
-     */
75
-    setAutoPlay(streamElement, autoPlay) {
76
-        if (!browser.isIExplorer()) {
77
-            streamElement.autoplay = autoPlay;
78
-        }
79
-    }
80
-};
81
-
82
-export default RTCUIHelper;

+ 53
- 171
modules/RTC/RTCUtils.js Ver arquivo

@@ -1,6 +1,5 @@
1
-/* global $,
1
+/* global
2 2
           __filename,
3
-          attachMediaStream,
4 3
           MediaStreamTrack,
5 4
           RTCIceCandidate: true,
6 5
           RTCPeerConnection,
@@ -28,13 +27,6 @@ import VideoType from '../../service/RTC/VideoType';
28 27
 
29 28
 const logger = getLogger(__filename);
30 29
 
31
-// XXX Don't require Temasys unless it's to be used because it doesn't run on
32
-// React Native, for example.
33
-const AdapterJS
34
-    = browser.isTemasysPluginUsed()
35
-        ? require('./adapter.screenshare')
36
-        : undefined;
37
-
38 30
 // Require adapter only for certain browsers. This is being done for
39 31
 // react-native, which has its own shims, and while browsers are being migrated
40 32
 // over to use adapter's shims.
@@ -113,7 +105,7 @@ const featureDetectionAudioEl = document.createElement('audio');
113 105
 const isAudioOutputDeviceChangeAvailable
114 106
     = typeof featureDetectionAudioEl.setSinkId !== 'undefined';
115 107
 
116
-let currentlyAvailableMediaDevices;
108
+let availableDevices;
117 109
 
118 110
 /**
119 111
  * "rawEnumerateDevicesWithCallback" will be initialized only after WebRTC is
@@ -123,7 +115,7 @@ let currentlyAvailableMediaDevices;
123 115
 let rawEnumerateDevicesWithCallback;
124 116
 
125 117
 /**
126
- *
118
+ * Initialize {@link rawEnumerateDevicesWithCallback}.
127 119
  */
128 120
 function initRawEnumerateDevicesWithCallback() {
129 121
     rawEnumerateDevicesWithCallback
@@ -134,19 +126,13 @@ function initRawEnumerateDevicesWithCallback() {
134 126
                     () => callback([]));
135 127
             }
136 128
 
137
-            // Safari:
138
-            // "ReferenceError: Can't find variable: MediaStreamTrack" when
139
-            // Temasys plugin is not installed yet, have to delay this call
140
-            // until WebRTC is ready.
141
-            : typeof MediaStreamTrack !== 'undefined'
142
-                && MediaStreamTrack.getSources
143
-                ? function(callback) {
144
-                    MediaStreamTrack.getSources(
145
-                        sources =>
146
-                            callback(
147
-                                sources.map(convertMediaStreamTrackSource)));
148
-                }
149
-                : undefined;
129
+            // react-native-webrtc
130
+            : function(callback) {
131
+                MediaStreamTrack.getSources(
132
+                    sources =>
133
+                        callback(
134
+                            sources.map(convertMediaStreamTrackSource)));
135
+            };
150 136
 }
151 137
 
152 138
 // TODO: currently no browser supports 'devicechange' event even in nightly
@@ -228,9 +214,8 @@ function getConstraints(um, options = {}) {
228 214
     // @see https://github.com/jitsi/lib-jitsi-meet/pull/136
229 215
     const isNewStyleConstraintsSupported
230 216
         = browser.isFirefox()
231
-        || browser.isEdge()
232
-        || browser.isReactNative()
233
-        || browser.isTemasysPluginUsed();
217
+            || browser.isEdge()
218
+            || browser.isReactNative();
234 219
 
235 220
     if (um.indexOf('video') >= 0) {
236 221
         // same behaviour as true
@@ -332,14 +317,6 @@ function getConstraints(um, options = {}) {
332 317
                 optional: []
333 318
             };
334 319
 
335
-        } else if (browser.isTemasysPluginUsed()) {
336
-            constraints.video = {
337
-                optional: [
338
-                    {
339
-                        sourceId: AdapterJS.WebRTCPlugin.plugin.screensharingKey
340
-                    }
341
-                ]
342
-            };
343 320
         } else if (browser.isFirefox()) {
344 321
             constraints.video = {
345 322
                 mozMediaSource: 'window',
@@ -353,7 +330,7 @@ function getConstraints(um, options = {}) {
353 330
         } else {
354 331
             const errmsg
355 332
                 = '\'screen\' WebRTC media source is supported only in Chrome'
356
-                    + ' and with Temasys plugin';
333
+                    + ' and Firefox';
357 334
 
358 335
             GlobalOnErrorHandler.callErrorHandler(new Error(errmsg));
359 336
             logger.error(errmsg);
@@ -549,7 +526,7 @@ function setAvailableDevices(um, stream) {
549 526
  * @returns {boolean} - true if list is different, false otherwise.
550 527
  */
551 528
 function compareAvailableMediaDevices(newDevices) {
552
-    if (newDevices.length !== currentlyAvailableMediaDevices.length) {
529
+    if (newDevices.length !== availableDevices.length) {
553 530
         return true;
554 531
     }
555 532
 
@@ -557,7 +534,7 @@ function compareAvailableMediaDevices(newDevices) {
557 534
 
558 535
     return (
559 536
         newDevices.map(mediaDeviceInfoToJSON).sort().join('')
560
-            !== currentlyAvailableMediaDevices
537
+            !== availableDevices
561 538
                 .map(mediaDeviceInfoToJSON).sort().join(''));
562 539
 
563 540
     /* eslint-enable newline-per-chained-call */
@@ -591,8 +568,8 @@ function pollForAvailableMediaDevices() {
591 568
         rawEnumerateDevicesWithCallback(ds => {
592 569
             // We don't fire RTCEvents.DEVICE_LIST_CHANGED for the first time
593 570
             // we call enumerateDevices(). This is the initial step.
594
-            if (typeof currentlyAvailableMediaDevices === 'undefined') {
595
-                currentlyAvailableMediaDevices = ds.slice(0);
571
+            if (typeof availableDevices === 'undefined') {
572
+                availableDevices = ds.slice(0);
596 573
             } else if (compareAvailableMediaDevices(ds)) {
597 574
                 onMediaDevicesListChanged(ds);
598 575
             }
@@ -643,17 +620,17 @@ function sendDeviceListToAnalytics(deviceList) {
643 620
  * @emits RTCEvents.DEVICE_LIST_CHANGED
644 621
  */
645 622
 function onMediaDevicesListChanged(devicesReceived) {
646
-    currentlyAvailableMediaDevices = devicesReceived.slice(0);
623
+    availableDevices = devicesReceived.slice(0);
647 624
     logger.info(
648 625
         'list of media devices has changed:',
649
-        currentlyAvailableMediaDevices);
626
+        availableDevices);
650 627
 
651
-    sendDeviceListToAnalytics(currentlyAvailableMediaDevices);
628
+    sendDeviceListToAnalytics(availableDevices);
652 629
 
653 630
     const videoInputDevices
654
-        = currentlyAvailableMediaDevices.filter(d => d.kind === 'videoinput');
631
+        = availableDevices.filter(d => d.kind === 'videoinput');
655 632
     const audioInputDevices
656
-        = currentlyAvailableMediaDevices.filter(d => d.kind === 'audioinput');
633
+        = availableDevices.filter(d => d.kind === 'audioinput');
657 634
     const videoInputDevicesWithEmptyLabels
658 635
         = videoInputDevices.filter(d => d.label === '');
659 636
     const audioInputDevicesWithEmptyLabels
@@ -720,16 +697,6 @@ function wrapGetUserMedia(getUserMedia, usePromises = false) {
720 697
     return gUM;
721 698
 }
722 699
 
723
-/**
724
- * Use old MediaStreamTrack to get devices list and
725
- * convert it to enumerateDevices format.
726
- * @param {Function} callback function to call when received devices list.
727
- */
728
-function enumerateDevicesThroughMediaStreamTrack(callback) {
729
-    MediaStreamTrack.getSources(
730
-        sources => callback(sources.map(convertMediaStreamTrackSource)));
731
-}
732
-
733 700
 /**
734 701
  * Converts MediaStreamTrack Source to enumerateDevices format.
735 702
  * @param {Object} source
@@ -976,8 +943,6 @@ class RTCUtils extends Listenable {
976 943
                         if (element) {
977 944
                             element.srcObject = stream;
978 945
                         }
979
-
980
-                        return element;
981 946
                     });
982 947
 
983 948
                 this.getStreamID = stream => stream.id;
@@ -1043,8 +1008,6 @@ class RTCUtils extends Listenable {
1043 1008
                 this.attachMediaStream
1044 1009
                     = wrapAttachMediaStream((element, stream) => {
1045 1010
                         defaultSetVideoSrc(element, stream);
1046
-
1047
-                        return element;
1048 1011
                     });
1049 1012
 
1050 1013
                 // ORTC does not generate remote MediaStreams so those are
@@ -1065,75 +1028,6 @@ class RTCUtils extends Listenable {
1065 1028
                 this.getTrackID = function(track) {
1066 1029
                     return track.jitsiRemoteId || track.id;
1067 1030
                 };
1068
-            } else if (browser.isTemasysPluginUsed()) {
1069
-                // Detect IE/Safari
1070
-                const webRTCReadyCb = () => {
1071
-                    this.RTCPeerConnectionType = RTCPeerConnection;
1072
-                    this.getUserMedia = window.getUserMedia;
1073
-                    this.enumerateDevices
1074
-                        = enumerateDevicesThroughMediaStreamTrack;
1075
-                    this.attachMediaStream
1076
-                        = wrapAttachMediaStream((element, stream) => {
1077
-                            if (stream) {
1078
-                                if (stream.id === 'dummyAudio'
1079
-                                        || stream.id === 'dummyVideo') {
1080
-                                    return;
1081
-                                }
1082
-
1083
-                                // The container must be visible in order to
1084
-                                // play or attach the stream when Temasys plugin
1085
-                                // is in use
1086
-                                const containerSel = $(element);
1087
-
1088
-                                if (browser.isTemasysPluginUsed()
1089
-                                        && !containerSel.is(':visible')) {
1090
-                                    containerSel.show();
1091
-                                }
1092
-                                const video
1093
-                                    = stream.getVideoTracks().length > 0;
1094
-
1095
-                                if (video && !$(element).is(':visible')) {
1096
-                                    throw new Error(
1097
-                                        'video element must be visible to'
1098
-                                            + ' attach video stream');
1099
-                                }
1100
-                            }
1101
-
1102
-                            return attachMediaStream(element, stream);
1103
-                        });
1104
-                    this.getStreamID
1105
-                        = stream => SDPUtil.filterSpecialChars(stream.label);
1106
-                    this.getTrackID
1107
-                        = track => track.id;
1108
-
1109
-                    onReady(
1110
-                        options,
1111
-                        this.getUserMediaWithConstraints.bind(this));
1112
-                };
1113
-                const webRTCReadyPromise
1114
-                    = new Promise(r => AdapterJS.webRTCReady(r));
1115
-
1116
-                // Resolve or reject depending on whether the Temasys plugin is
1117
-                // installed.
1118
-                AdapterJS.WebRTCPlugin.isPluginInstalled(
1119
-                    AdapterJS.WebRTCPlugin.pluginInfo.prefix,
1120
-                    AdapterJS.WebRTCPlugin.pluginInfo.plugName,
1121
-                    AdapterJS.WebRTCPlugin.pluginInfo.type,
1122
-                    /* installed */ () => {
1123
-                        webRTCReadyPromise.then(() => {
1124
-                            webRTCReadyCb();
1125
-                            resolve();
1126
-                        });
1127
-                    },
1128
-                    /* not installed */ () => {
1129
-                        const error
1130
-                            = new Error('Temasys plugin is not installed');
1131
-
1132
-                        error.name = 'WEBRTC_NOT_READY';
1133
-                        error.webRTCReadyPromise = webRTCReadyPromise;
1134
-
1135
-                        reject(error);
1136
-                    });
1137 1031
             } else {
1138 1032
                 rejectWithWebRTCNotSupported(
1139 1033
                     'Browser does not appear to be WebRTC-capable',
@@ -1144,11 +1038,34 @@ class RTCUtils extends Listenable {
1144 1038
 
1145 1039
             this._initPCConstraints(options);
1146 1040
 
1147
-            // Call onReady() if Temasys plugin is not used
1148
-            if (!browser.isTemasysPluginUsed()) {
1149
-                onReady(options, this.getUserMediaWithConstraints.bind(this));
1150
-                resolve();
1041
+            rtcReady = true;
1042
+            eventEmitter.emit(RTCEvents.RTC_READY, true);
1043
+            screenObtainer.init(
1044
+                options, this.getUserMediaWithConstraints.bind(this));
1045
+
1046
+            if (this.isDeviceListAvailable()
1047
+                    && rawEnumerateDevicesWithCallback) {
1048
+                rawEnumerateDevicesWithCallback(ds => {
1049
+                    availableDevices = ds.splice(0);
1050
+
1051
+                    logger.debug('Available devices: ', availableDevices);
1052
+                    sendDeviceListToAnalytics(availableDevices);
1053
+
1054
+                    eventEmitter.emit(RTCEvents.DEVICE_LIST_AVAILABLE,
1055
+                        availableDevices);
1056
+
1057
+                    if (isDeviceChangeEventSupported) {
1058
+                        navigator.mediaDevices.addEventListener(
1059
+                            'devicechange',
1060
+                            () => this.enumerateDevices(
1061
+                                    onMediaDevicesListChanged));
1062
+                    } else {
1063
+                        pollForAvailableMediaDevices();
1064
+                    }
1065
+                });
1151 1066
             }
1067
+
1068
+            resolve();
1152 1069
         });
1153 1070
     }
1154 1071
 
@@ -1782,7 +1699,6 @@ class RTCUtils extends Listenable {
1782 1699
             : browser.isChrome()
1783 1700
                 || browser.isFirefox()
1784 1701
                 || browser.isOpera()
1785
-                || browser.isTemasysPluginUsed()
1786 1702
                 || browser.isNWJS()
1787 1703
                 || browser.isElectron()
1788 1704
                 || browser.isEdge();
@@ -1795,8 +1711,7 @@ class RTCUtils extends Listenable {
1795 1711
      */
1796 1712
     stopMediaStream(mediaStream) {
1797 1713
         mediaStream.getTracks().forEach(track => {
1798
-            // stop() not supported with IE
1799
-            if (!browser.isTemasysPluginUsed() && track.stop) {
1714
+            if (track.stop) {
1800 1715
                 track.stop();
1801 1716
             }
1802 1717
         });
@@ -1871,7 +1786,7 @@ class RTCUtils extends Listenable {
1871 1786
      * @returns {Array} list of available media devices.
1872 1787
      */
1873 1788
     getCurrentlyAvailableMediaDevices() {
1874
-        return currentlyAvailableMediaDevices;
1789
+        return availableDevices;
1875 1790
     }
1876 1791
 
1877 1792
     /**
@@ -1928,8 +1843,8 @@ class RTCUtils extends Listenable {
1928 1843
 function rejectWithWebRTCNotSupported(errorMessage, reject) {
1929 1844
     const error = new Error(errorMessage);
1930 1845
 
1931
-    // WebRTC is not supported either natively or via a known plugin such as
1932
-    // Temasys.
1846
+    // WebRTC is not supported.
1847
+    //
1933 1848
     // XXX The Error class already has a property name which is commonly used to
1934 1849
     // detail the represented error in a non-human-readable way (in contrast to
1935 1850
     // the human-readable property message). I explicitly did not want to
@@ -1972,39 +1887,6 @@ function obtainDevices(options) {
1972 1887
         });
1973 1888
 }
1974 1889
 
1975
-/**
1976
- * In case of IE we continue from 'onReady' callback passed to RTCUtils
1977
- * constructor. It will be invoked by Temasys plugin once it is initialized.
1978
- *
1979
- * @param options
1980
- * @param GUM
1981
- */
1982
-function onReady(options, GUM) {
1983
-    rtcReady = true;
1984
-    eventEmitter.emit(RTCEvents.RTC_READY, true);
1985
-    screenObtainer.init(options, GUM);
1986
-
1987
-    if (rtcUtils.isDeviceListAvailable() && rawEnumerateDevicesWithCallback) {
1988
-        rawEnumerateDevicesWithCallback(ds => {
1989
-            currentlyAvailableMediaDevices = ds.splice(0);
1990
-
1991
-            logger.info('Available devices: ', currentlyAvailableMediaDevices);
1992
-            sendDeviceListToAnalytics(currentlyAvailableMediaDevices);
1993
-
1994
-            eventEmitter.emit(RTCEvents.DEVICE_LIST_AVAILABLE,
1995
-                currentlyAvailableMediaDevices);
1996
-
1997
-            if (isDeviceChangeEventSupported) {
1998
-                navigator.mediaDevices.addEventListener(
1999
-                    'devicechange',
2000
-                    () => rtcUtils.enumerateDevices(onMediaDevicesListChanged));
2001
-            } else {
2002
-                pollForAvailableMediaDevices();
2003
-            }
2004
-        });
2005
-    }
2006
-}
2007
-
2008 1890
 /**
2009 1891
  * Wraps original attachMediaStream function to set current audio output device
2010 1892
  * if this is supported.

+ 0
- 22
modules/RTC/ScreenObtainer.js Ver arquivo

@@ -162,28 +162,6 @@ const ScreenObtainer = {
162 162
             };
163 163
         } else if (browser.isElectron()) {
164 164
             return this.obtainScreenOnElectron;
165
-        } else if (browser.isTemasysPluginUsed()) {
166
-            // XXX Don't require Temasys unless it's to be used because it
167
-            // doesn't run on React Native, for example.
168
-            const plugin
169
-                = require('./adapter.screenshare').WebRTCPlugin.plugin;
170
-
171
-            if (!plugin.HasScreensharingFeature) {
172
-                logger.warn(
173
-                    'Screensharing not supported by this plugin version');
174
-
175
-                return null;
176
-            } else if (!plugin.isScreensharingAvailable) {
177
-                logger.warn(
178
-                    'Screensharing not available with Temasys plugin on'
179
-                        + ' this site');
180
-
181
-                return null;
182
-            }
183
-
184
-            logger.info('Using Temasys plugin for desktop sharing');
185
-
186
-            return obtainWebRTCScreen;
187 165
         } else if (browser.isChrome() || browser.isOpera()) {
188 166
             if (browser.isVersionLessThan('34')) {
189 167
                 logger.info('Chrome extension not supported until ver 34');

+ 7
- 46
modules/RTC/TraceablePeerConnection.js Ver arquivo

@@ -127,8 +127,7 @@ export default function TraceablePeerConnection(
127 127
 
128 128
     /**
129 129
      * Keeps tracks of the WebRTC <tt>MediaStream</tt>s that have been added to
130
-     * the underlying WebRTC PeerConnection. An Array is used to avoid errors in
131
-     * IE11 with adding temasys MediaStream objects into other data structures.
130
+     * the underlying WebRTC PeerConnection.
132 131
      * @type {Array}
133 132
      * @private
134 133
      */
@@ -228,15 +227,6 @@ export default function TraceablePeerConnection(
228 227
     this.trace = (what, info) => {
229 228
         logger.debug(what, info);
230 229
 
231
-        /*
232
-        if (info && browser.isIExplorer()) {
233
-            if (info.length > 1024) {
234
-                logger.warn('WTRACE', what, info.substr(1024));
235
-            }
236
-            if (info.length > 2048) {
237
-                logger.warn('WTRACE', what, info.substr(2048));
238
-            }
239
-        }*/
240 230
         this.updateLog.push({
241 231
             time: new Date(),
242 232
             type: what,
@@ -245,12 +235,9 @@ export default function TraceablePeerConnection(
245 235
     };
246 236
     this.onicecandidate = null;
247 237
     this.peerconnection.onicecandidate = event => {
248
-        // FIXME: this causes stack overflow with Temasys Plugin
249
-        if (!browser.isTemasysPluginUsed()) {
250
-            this.trace(
251
-                'onicecandidate',
252
-                JSON.stringify(event.candidate, null, ' '));
253
-        }
238
+        this.trace(
239
+            'onicecandidate',
240
+            JSON.stringify(event.candidate, null, ' '));
254 241
 
255 242
         if (this.onicecandidate !== null) {
256 243
             this.onicecandidate(event);
@@ -670,14 +657,8 @@ TraceablePeerConnection.prototype._remoteTrackAdded = function(stream, track) {
670 657
 
671 658
     let ssrcLines = SDPUtil.findLines(mediaLines[0], 'a=ssrc:');
672 659
 
673
-    ssrcLines = ssrcLines.filter(
674
-        line => {
675
-            const msid
676
-                = browser.isTemasysPluginUsed() ? 'mslabel' : 'msid';
677
-
678
-
679
-            return line.indexOf(`${msid}:${streamId}`) !== -1;
680
-        });
660
+    ssrcLines
661
+        = ssrcLines.filter(line => line.indexOf(`msid:${streamId}`) !== -1);
681 662
     if (!ssrcLines.length) {
682 663
         GlobalOnErrorHandler.callErrorHandler(
683 664
             new Error(
@@ -2326,7 +2307,6 @@ TraceablePeerConnection.prototype._createOfferOrAnswer = function(
2326 2307
         failureCallback(err);
2327 2308
     };
2328 2309
 
2329
-    // NOTE Temasys plugin does not support "bind" on peerconnection methods
2330 2310
     if (isOffer) {
2331 2311
         this.peerconnection.createOffer(
2332 2312
             _successCallback, _errorCallback, constraints);
@@ -2406,10 +2386,6 @@ TraceablePeerConnection.prototype.addIceCandidate = function(
2406 2386
         candidate,
2407 2387
         successCallback,
2408 2388
         failureCallback) {
2409
-    // var self = this;
2410
-
2411
-    // Calling JSON.stringify with temasys objects causes a stack overflow, so
2412
-    // instead pick out values to log.
2413 2389
     this.trace('addIceCandidate', JSON.stringify({
2414 2390
         candidate: candidate.candidate,
2415 2391
         sdpMid: candidate.sdpMid,
@@ -2418,19 +2394,6 @@ TraceablePeerConnection.prototype.addIceCandidate = function(
2418 2394
     }, null, ' '));
2419 2395
     this.peerconnection.addIceCandidate(
2420 2396
         candidate, successCallback, failureCallback);
2421
-
2422
-    /* maybe later
2423
-     this.peerconnection.addIceCandidate(candidate,
2424
-     function () {
2425
-     self.trace('addIceCandidateOnSuccess');
2426
-     successCallback();
2427
-     },
2428
-     function (err) {
2429
-     self.trace('addIceCandidateOnFailure', err);
2430
-     failureCallback(err);
2431
-     }
2432
-     );
2433
-     */
2434 2397
 };
2435 2398
 
2436 2399
 /**
@@ -2443,12 +2406,10 @@ TraceablePeerConnection.prototype.addIceCandidate = function(
2443 2406
  * @returns {void}
2444 2407
  */
2445 2408
 TraceablePeerConnection.prototype.getStats = function(callback, errback) {
2446
-    // TODO: Is this the correct way to handle Opera, Temasys?
2447 2409
     // TODO (brian): After moving all browsers to adapter, check if adapter is
2448 2410
     // accounting for different getStats apis, making the browser-checking-if
2449 2411
     // unnecessary.
2450
-    if (browser.isTemasysPluginUsed()
2451
-        || browser.isReactNative()) {
2412
+    if (browser.isReactNative()) {
2452 2413
         this.peerconnection.getStats(
2453 2414
             null,
2454 2415
             callback,

+ 0
- 4292
modules/RTC/adapter.screenshare.js
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 1
- 18
modules/browser/BrowserCapabilities.js Ver arquivo

@@ -58,22 +58,6 @@ export default class BrowserCapabilities extends BrowserDetection {
58 58
             && !this.isVersionLessThan('11');
59 59
     }
60 60
 
61
-    /**
62
-     * Checks if Temasys RTC plugin is used.
63
-     * @returns {boolean}
64
-     */
65
-    isTemasysPluginUsed() {
66
-        // Temasys do not support Microsoft Edge:
67
-        // http://support.temasys.com.sg/support/solutions/articles/
68
-        // 5000654345-can-the-temasys-webrtc-plugin-be-used-with-microsoft-edge-
69
-        return (
70
-            (this.isSafari()
71
-                && !this.isSafariWithWebrtc())
72
-            || (this.isIExplorer()
73
-                && this.isVersionLessThan('12'))
74
-        );
75
-    }
76
-
77 61
     /**
78 62
      * Checks if the current browser triggers 'onmute'/'onunmute' events when
79 63
      * user's connection is interrupted and the video stops playback.
@@ -114,8 +98,7 @@ export default class BrowserCapabilities extends BrowserDetection {
114 98
      * @return {boolean}
115 99
      */
116 100
     supportsMediaStreamConstructor() {
117
-        return !this.isReactNative()
118
-            && !this.isTemasysPluginUsed();
101
+        return !this.isReactNative();
119 102
     }
120 103
 
121 104
     /**

+ 1
- 3
modules/statistics/LocalStatsCollector.js Ver arquivo

@@ -2,8 +2,6 @@
2 2
  * Provides statistics for the local stream.
3 3
  */
4 4
 
5
-import browser from '../browser';
6
-
7 5
 /**
8 6
  * Size of the webaudio analyzer buffer.
9 7
  * @type {number}
@@ -145,5 +143,5 @@ LocalStatsCollector.prototype.stop = function() {
145 143
  * @returns {boolean}
146 144
  */
147 145
 LocalStatsCollector.isLocalStatsSupported = function() {
148
-    return Boolean(context && !browser.isTemasysPluginUsed());
146
+    return Boolean(context);
149 147
 };

+ 1
- 3
modules/statistics/RTPStatsCollector.js Ver arquivo

@@ -11,7 +11,7 @@ const logger = require('jitsi-meet-logger').getLogger(__filename);
11 11
 const browserSupported = browser.isChrome()
12 12
         || browser.isOpera() || browser.isFirefox()
13 13
         || browser.isNWJS() || browser.isElectron()
14
-        || browser.isTemasysPluginUsed() || browser.isEdge()
14
+        || browser.isEdge()
15 15
         || browser.isSafariWithWebrtc() || browser.isReactNative();
16 16
 
17 17
 /**
@@ -88,8 +88,6 @@ KEYS_BY_BROWSER_TYPE[browsers.NWJS]
88 88
     = KEYS_BY_BROWSER_TYPE[browsers.CHROME];
89 89
 KEYS_BY_BROWSER_TYPE[browsers.ELECTRON]
90 90
     = KEYS_BY_BROWSER_TYPE[browsers.CHROME];
91
-KEYS_BY_BROWSER_TYPE[browsers.IEXPLORER]
92
-    = KEYS_BY_BROWSER_TYPE[browsers.CHROME];
93 91
 KEYS_BY_BROWSER_TYPE[browsers.SAFARI]
94 92
     = KEYS_BY_BROWSER_TYPE[browsers.CHROME];
95 93
 KEYS_BY_BROWSER_TYPE[browsers.REACT_NATIVE]

+ 0
- 1
webpack.config.js Ver arquivo

@@ -42,7 +42,6 @@ const config = {
42 42
             // Transpile ES2015 (aka ES6) to ES5.
43 43
 
44 44
             exclude: [
45
-                `${__dirname}/modules/RTC/adapter.screenshare.js`,
46 45
                 new RegExp(`${__dirname}/node_modules/(?!js-utils)`)
47 46
             ],
48 47
             loader: 'babel-loader',

Carregando…
Cancelar
Salvar