Browse Source

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

master
Saúl Ibarra Corretgé 6 years ago
parent
commit
826dacdc7d

+ 0
- 1
.eslintignore View File

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

+ 1
- 1
JitsiMediaDevicesEvents.js View File

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

+ 0
- 2
JitsiMeetJS.js View File

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

+ 1
- 1
doc/API.md View File

138
 
138
 
139
     4. mediaDevices
139
     4. mediaDevices
140
         - DEVICE_LIST_CHANGED - indicates that list of currently connected devices has changed (parameters - devices(MediaDeviceInfo[])).
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
 * ```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
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 View File

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

+ 4
- 36
modules/RTC/JitsiRemoteTrack.js View File

1
 import { createTtfmEvent } from '../../service/statistics/AnalyticsEvents';
1
 import { createTtfmEvent } from '../../service/statistics/AnalyticsEvents';
2
 import JitsiTrack from './JitsiTrack';
2
 import JitsiTrack from './JitsiTrack';
3
 import * as JitsiTrackEvents from '../../JitsiTrackEvents';
3
 import * as JitsiTrackEvents from '../../JitsiTrackEvents';
4
-import browser from '../browser';
5
 import Statistics from '../statistics/statistics';
4
 import Statistics from '../statistics/statistics';
6
 
5
 
7
 const logger = require('jitsi-meet-logger').getLogger(__filename);
6
 const logger = require('jitsi-meet-logger').getLogger(__filename);
83
      * @returns {void}
82
      * @returns {void}
84
      */
83
      */
85
     _bindMuteHandlers() {
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
      * Attach time to first media tracker only if there is conference and only
229
      * Attach time to first media tracker only if there is conference and only
247
      * for the first element.
230
      * for the first element.
248
      * @param container the HTML container which can be 'video' or 'audio'
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
      * @private
233
      * @private
252
      */
234
      */
253
     _attachTTFMTracker(container) {
235
     _attachTTFMTracker(container) {
263
             ttfmTrackerVideoAttached = true;
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 View File

22
  * @param handler the handler
22
  * @param handler the handler
23
  */
23
  */
24
 function addMediaStreamInactiveHandler(mediaStream, handler) {
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
     /**
267
     /**
273
      * Attaches the MediaStream of this track to an HTML container.
268
      * Attaches the MediaStream of this track to an HTML container.
274
      * Adds the container to the list of containers that are displaying the
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
      * @param container the HTML container which can be 'video' or 'audio'
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
     attach(container) {
277
     attach(container) {
290
-        let c = container;
291
-
292
         if (this.stream) {
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
      * for the first element.
313
      * for the first element.
330
      *
314
      *
331
      * @param {HTMLElement} container the HTML container which can be 'video' or
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
      * @private
317
      * @private
336
      */
318
      */
337
     _attachTTFMTracker(container) { // eslint-disable-line no-unused-vars
319
     _attachTTFMTracker(container) { // eslint-disable-line no-unused-vars

+ 0
- 82
modules/RTC/RTCUIHelper.js View File

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 View File

1
-/* global $,
1
+/* global
2
           __filename,
2
           __filename,
3
-          attachMediaStream,
4
           MediaStreamTrack,
3
           MediaStreamTrack,
5
           RTCIceCandidate: true,
4
           RTCIceCandidate: true,
6
           RTCPeerConnection,
5
           RTCPeerConnection,
28
 
27
 
29
 const logger = getLogger(__filename);
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
 // Require adapter only for certain browsers. This is being done for
30
 // Require adapter only for certain browsers. This is being done for
39
 // react-native, which has its own shims, and while browsers are being migrated
31
 // react-native, which has its own shims, and while browsers are being migrated
40
 // over to use adapter's shims.
32
 // over to use adapter's shims.
113
 const isAudioOutputDeviceChangeAvailable
105
 const isAudioOutputDeviceChangeAvailable
114
     = typeof featureDetectionAudioEl.setSinkId !== 'undefined';
106
     = typeof featureDetectionAudioEl.setSinkId !== 'undefined';
115
 
107
 
116
-let currentlyAvailableMediaDevices;
108
+let availableDevices;
117
 
109
 
118
 /**
110
 /**
119
  * "rawEnumerateDevicesWithCallback" will be initialized only after WebRTC is
111
  * "rawEnumerateDevicesWithCallback" will be initialized only after WebRTC is
123
 let rawEnumerateDevicesWithCallback;
115
 let rawEnumerateDevicesWithCallback;
124
 
116
 
125
 /**
117
 /**
126
- *
118
+ * Initialize {@link rawEnumerateDevicesWithCallback}.
127
  */
119
  */
128
 function initRawEnumerateDevicesWithCallback() {
120
 function initRawEnumerateDevicesWithCallback() {
129
     rawEnumerateDevicesWithCallback
121
     rawEnumerateDevicesWithCallback
134
                     () => callback([]));
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
 // TODO: currently no browser supports 'devicechange' event even in nightly
138
 // TODO: currently no browser supports 'devicechange' event even in nightly
228
     // @see https://github.com/jitsi/lib-jitsi-meet/pull/136
214
     // @see https://github.com/jitsi/lib-jitsi-meet/pull/136
229
     const isNewStyleConstraintsSupported
215
     const isNewStyleConstraintsSupported
230
         = browser.isFirefox()
216
         = browser.isFirefox()
231
-        || browser.isEdge()
232
-        || browser.isReactNative()
233
-        || browser.isTemasysPluginUsed();
217
+            || browser.isEdge()
218
+            || browser.isReactNative();
234
 
219
 
235
     if (um.indexOf('video') >= 0) {
220
     if (um.indexOf('video') >= 0) {
236
         // same behaviour as true
221
         // same behaviour as true
332
                 optional: []
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
         } else if (browser.isFirefox()) {
320
         } else if (browser.isFirefox()) {
344
             constraints.video = {
321
             constraints.video = {
345
                 mozMediaSource: 'window',
322
                 mozMediaSource: 'window',
353
         } else {
330
         } else {
354
             const errmsg
331
             const errmsg
355
                 = '\'screen\' WebRTC media source is supported only in Chrome'
332
                 = '\'screen\' WebRTC media source is supported only in Chrome'
356
-                    + ' and with Temasys plugin';
333
+                    + ' and Firefox';
357
 
334
 
358
             GlobalOnErrorHandler.callErrorHandler(new Error(errmsg));
335
             GlobalOnErrorHandler.callErrorHandler(new Error(errmsg));
359
             logger.error(errmsg);
336
             logger.error(errmsg);
549
  * @returns {boolean} - true if list is different, false otherwise.
526
  * @returns {boolean} - true if list is different, false otherwise.
550
  */
527
  */
551
 function compareAvailableMediaDevices(newDevices) {
528
 function compareAvailableMediaDevices(newDevices) {
552
-    if (newDevices.length !== currentlyAvailableMediaDevices.length) {
529
+    if (newDevices.length !== availableDevices.length) {
553
         return true;
530
         return true;
554
     }
531
     }
555
 
532
 
557
 
534
 
558
     return (
535
     return (
559
         newDevices.map(mediaDeviceInfoToJSON).sort().join('')
536
         newDevices.map(mediaDeviceInfoToJSON).sort().join('')
560
-            !== currentlyAvailableMediaDevices
537
+            !== availableDevices
561
                 .map(mediaDeviceInfoToJSON).sort().join(''));
538
                 .map(mediaDeviceInfoToJSON).sort().join(''));
562
 
539
 
563
     /* eslint-enable newline-per-chained-call */
540
     /* eslint-enable newline-per-chained-call */
591
         rawEnumerateDevicesWithCallback(ds => {
568
         rawEnumerateDevicesWithCallback(ds => {
592
             // We don't fire RTCEvents.DEVICE_LIST_CHANGED for the first time
569
             // We don't fire RTCEvents.DEVICE_LIST_CHANGED for the first time
593
             // we call enumerateDevices(). This is the initial step.
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
             } else if (compareAvailableMediaDevices(ds)) {
573
             } else if (compareAvailableMediaDevices(ds)) {
597
                 onMediaDevicesListChanged(ds);
574
                 onMediaDevicesListChanged(ds);
598
             }
575
             }
643
  * @emits RTCEvents.DEVICE_LIST_CHANGED
620
  * @emits RTCEvents.DEVICE_LIST_CHANGED
644
  */
621
  */
645
 function onMediaDevicesListChanged(devicesReceived) {
622
 function onMediaDevicesListChanged(devicesReceived) {
646
-    currentlyAvailableMediaDevices = devicesReceived.slice(0);
623
+    availableDevices = devicesReceived.slice(0);
647
     logger.info(
624
     logger.info(
648
         'list of media devices has changed:',
625
         'list of media devices has changed:',
649
-        currentlyAvailableMediaDevices);
626
+        availableDevices);
650
 
627
 
651
-    sendDeviceListToAnalytics(currentlyAvailableMediaDevices);
628
+    sendDeviceListToAnalytics(availableDevices);
652
 
629
 
653
     const videoInputDevices
630
     const videoInputDevices
654
-        = currentlyAvailableMediaDevices.filter(d => d.kind === 'videoinput');
631
+        = availableDevices.filter(d => d.kind === 'videoinput');
655
     const audioInputDevices
632
     const audioInputDevices
656
-        = currentlyAvailableMediaDevices.filter(d => d.kind === 'audioinput');
633
+        = availableDevices.filter(d => d.kind === 'audioinput');
657
     const videoInputDevicesWithEmptyLabels
634
     const videoInputDevicesWithEmptyLabels
658
         = videoInputDevices.filter(d => d.label === '');
635
         = videoInputDevices.filter(d => d.label === '');
659
     const audioInputDevicesWithEmptyLabels
636
     const audioInputDevicesWithEmptyLabels
720
     return gUM;
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
  * Converts MediaStreamTrack Source to enumerateDevices format.
701
  * Converts MediaStreamTrack Source to enumerateDevices format.
735
  * @param {Object} source
702
  * @param {Object} source
976
                         if (element) {
943
                         if (element) {
977
                             element.srcObject = stream;
944
                             element.srcObject = stream;
978
                         }
945
                         }
979
-
980
-                        return element;
981
                     });
946
                     });
982
 
947
 
983
                 this.getStreamID = stream => stream.id;
948
                 this.getStreamID = stream => stream.id;
1043
                 this.attachMediaStream
1008
                 this.attachMediaStream
1044
                     = wrapAttachMediaStream((element, stream) => {
1009
                     = wrapAttachMediaStream((element, stream) => {
1045
                         defaultSetVideoSrc(element, stream);
1010
                         defaultSetVideoSrc(element, stream);
1046
-
1047
-                        return element;
1048
                     });
1011
                     });
1049
 
1012
 
1050
                 // ORTC does not generate remote MediaStreams so those are
1013
                 // ORTC does not generate remote MediaStreams so those are
1065
                 this.getTrackID = function(track) {
1028
                 this.getTrackID = function(track) {
1066
                     return track.jitsiRemoteId || track.id;
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
             } else {
1031
             } else {
1138
                 rejectWithWebRTCNotSupported(
1032
                 rejectWithWebRTCNotSupported(
1139
                     'Browser does not appear to be WebRTC-capable',
1033
                     'Browser does not appear to be WebRTC-capable',
1144
 
1038
 
1145
             this._initPCConstraints(options);
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
             : browser.isChrome()
1699
             : browser.isChrome()
1783
                 || browser.isFirefox()
1700
                 || browser.isFirefox()
1784
                 || browser.isOpera()
1701
                 || browser.isOpera()
1785
-                || browser.isTemasysPluginUsed()
1786
                 || browser.isNWJS()
1702
                 || browser.isNWJS()
1787
                 || browser.isElectron()
1703
                 || browser.isElectron()
1788
                 || browser.isEdge();
1704
                 || browser.isEdge();
1795
      */
1711
      */
1796
     stopMediaStream(mediaStream) {
1712
     stopMediaStream(mediaStream) {
1797
         mediaStream.getTracks().forEach(track => {
1713
         mediaStream.getTracks().forEach(track => {
1798
-            // stop() not supported with IE
1799
-            if (!browser.isTemasysPluginUsed() && track.stop) {
1714
+            if (track.stop) {
1800
                 track.stop();
1715
                 track.stop();
1801
             }
1716
             }
1802
         });
1717
         });
1871
      * @returns {Array} list of available media devices.
1786
      * @returns {Array} list of available media devices.
1872
      */
1787
      */
1873
     getCurrentlyAvailableMediaDevices() {
1788
     getCurrentlyAvailableMediaDevices() {
1874
-        return currentlyAvailableMediaDevices;
1789
+        return availableDevices;
1875
     }
1790
     }
1876
 
1791
 
1877
     /**
1792
     /**
1928
 function rejectWithWebRTCNotSupported(errorMessage, reject) {
1843
 function rejectWithWebRTCNotSupported(errorMessage, reject) {
1929
     const error = new Error(errorMessage);
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
     // XXX The Error class already has a property name which is commonly used to
1848
     // XXX The Error class already has a property name which is commonly used to
1934
     // detail the represented error in a non-human-readable way (in contrast to
1849
     // detail the represented error in a non-human-readable way (in contrast to
1935
     // the human-readable property message). I explicitly did not want to
1850
     // the human-readable property message). I explicitly did not want to
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
  * Wraps original attachMediaStream function to set current audio output device
1891
  * Wraps original attachMediaStream function to set current audio output device
2010
  * if this is supported.
1892
  * if this is supported.

+ 0
- 22
modules/RTC/ScreenObtainer.js View File

162
             };
162
             };
163
         } else if (browser.isElectron()) {
163
         } else if (browser.isElectron()) {
164
             return this.obtainScreenOnElectron;
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
         } else if (browser.isChrome() || browser.isOpera()) {
165
         } else if (browser.isChrome() || browser.isOpera()) {
188
             if (browser.isVersionLessThan('34')) {
166
             if (browser.isVersionLessThan('34')) {
189
                 logger.info('Chrome extension not supported until ver 34');
167
                 logger.info('Chrome extension not supported until ver 34');

+ 7
- 46
modules/RTC/TraceablePeerConnection.js View File

127
 
127
 
128
     /**
128
     /**
129
      * Keeps tracks of the WebRTC <tt>MediaStream</tt>s that have been added to
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
      * @type {Array}
131
      * @type {Array}
133
      * @private
132
      * @private
134
      */
133
      */
228
     this.trace = (what, info) => {
227
     this.trace = (what, info) => {
229
         logger.debug(what, info);
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
         this.updateLog.push({
230
         this.updateLog.push({
241
             time: new Date(),
231
             time: new Date(),
242
             type: what,
232
             type: what,
245
     };
235
     };
246
     this.onicecandidate = null;
236
     this.onicecandidate = null;
247
     this.peerconnection.onicecandidate = event => {
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
         if (this.onicecandidate !== null) {
242
         if (this.onicecandidate !== null) {
256
             this.onicecandidate(event);
243
             this.onicecandidate(event);
670
 
657
 
671
     let ssrcLines = SDPUtil.findLines(mediaLines[0], 'a=ssrc:');
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
     if (!ssrcLines.length) {
662
     if (!ssrcLines.length) {
682
         GlobalOnErrorHandler.callErrorHandler(
663
         GlobalOnErrorHandler.callErrorHandler(
683
             new Error(
664
             new Error(
2326
         failureCallback(err);
2307
         failureCallback(err);
2327
     };
2308
     };
2328
 
2309
 
2329
-    // NOTE Temasys plugin does not support "bind" on peerconnection methods
2330
     if (isOffer) {
2310
     if (isOffer) {
2331
         this.peerconnection.createOffer(
2311
         this.peerconnection.createOffer(
2332
             _successCallback, _errorCallback, constraints);
2312
             _successCallback, _errorCallback, constraints);
2406
         candidate,
2386
         candidate,
2407
         successCallback,
2387
         successCallback,
2408
         failureCallback) {
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
     this.trace('addIceCandidate', JSON.stringify({
2389
     this.trace('addIceCandidate', JSON.stringify({
2414
         candidate: candidate.candidate,
2390
         candidate: candidate.candidate,
2415
         sdpMid: candidate.sdpMid,
2391
         sdpMid: candidate.sdpMid,
2418
     }, null, ' '));
2394
     }, null, ' '));
2419
     this.peerconnection.addIceCandidate(
2395
     this.peerconnection.addIceCandidate(
2420
         candidate, successCallback, failureCallback);
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
  * @returns {void}
2406
  * @returns {void}
2444
  */
2407
  */
2445
 TraceablePeerConnection.prototype.getStats = function(callback, errback) {
2408
 TraceablePeerConnection.prototype.getStats = function(callback, errback) {
2446
-    // TODO: Is this the correct way to handle Opera, Temasys?
2447
     // TODO (brian): After moving all browsers to adapter, check if adapter is
2409
     // TODO (brian): After moving all browsers to adapter, check if adapter is
2448
     // accounting for different getStats apis, making the browser-checking-if
2410
     // accounting for different getStats apis, making the browser-checking-if
2449
     // unnecessary.
2411
     // unnecessary.
2450
-    if (browser.isTemasysPluginUsed()
2451
-        || browser.isReactNative()) {
2412
+    if (browser.isReactNative()) {
2452
         this.peerconnection.getStats(
2413
         this.peerconnection.getStats(
2453
             null,
2414
             null,
2454
             callback,
2415
             callback,

+ 0
- 4292
modules/RTC/adapter.screenshare.js
File diff suppressed because it is too large
View File


+ 1
- 18
modules/browser/BrowserCapabilities.js View File

58
             && !this.isVersionLessThan('11');
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
      * Checks if the current browser triggers 'onmute'/'onunmute' events when
62
      * Checks if the current browser triggers 'onmute'/'onunmute' events when
79
      * user's connection is interrupted and the video stops playback.
63
      * user's connection is interrupted and the video stops playback.
114
      * @return {boolean}
98
      * @return {boolean}
115
      */
99
      */
116
     supportsMediaStreamConstructor() {
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 View File

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

+ 1
- 3
modules/statistics/RTPStatsCollector.js View File

11
 const browserSupported = browser.isChrome()
11
 const browserSupported = browser.isChrome()
12
         || browser.isOpera() || browser.isFirefox()
12
         || browser.isOpera() || browser.isFirefox()
13
         || browser.isNWJS() || browser.isElectron()
13
         || browser.isNWJS() || browser.isElectron()
14
-        || browser.isTemasysPluginUsed() || browser.isEdge()
14
+        || browser.isEdge()
15
         || browser.isSafariWithWebrtc() || browser.isReactNative();
15
         || browser.isSafariWithWebrtc() || browser.isReactNative();
16
 
16
 
17
 /**
17
 /**
88
     = KEYS_BY_BROWSER_TYPE[browsers.CHROME];
88
     = KEYS_BY_BROWSER_TYPE[browsers.CHROME];
89
 KEYS_BY_BROWSER_TYPE[browsers.ELECTRON]
89
 KEYS_BY_BROWSER_TYPE[browsers.ELECTRON]
90
     = KEYS_BY_BROWSER_TYPE[browsers.CHROME];
90
     = KEYS_BY_BROWSER_TYPE[browsers.CHROME];
91
-KEYS_BY_BROWSER_TYPE[browsers.IEXPLORER]
92
-    = KEYS_BY_BROWSER_TYPE[browsers.CHROME];
93
 KEYS_BY_BROWSER_TYPE[browsers.SAFARI]
91
 KEYS_BY_BROWSER_TYPE[browsers.SAFARI]
94
     = KEYS_BY_BROWSER_TYPE[browsers.CHROME];
92
     = KEYS_BY_BROWSER_TYPE[browsers.CHROME];
95
 KEYS_BY_BROWSER_TYPE[browsers.REACT_NATIVE]
93
 KEYS_BY_BROWSER_TYPE[browsers.REACT_NATIVE]

+ 0
- 1
webpack.config.js View File

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

Loading…
Cancel
Save