|
@@ -38,12 +38,6 @@ import { VideoType } from './service/RTC/VideoType';
|
38
|
38
|
|
39
|
39
|
const logger = Logger.getLogger(__filename);
|
40
|
40
|
|
41
|
|
-/**
|
42
|
|
- * The amount of time to wait until firing
|
43
|
|
- * {@link JitsiMediaDevicesEvents.PERMISSION_PROMPT_IS_SHOWN} event.
|
44
|
|
- */
|
45
|
|
-const USER_MEDIA_SLOW_PROMISE_TIMEOUT = 1000;
|
46
|
|
-
|
47
|
41
|
/**
|
48
|
42
|
* Indicates whether GUM has been executed or not.
|
49
|
43
|
*/
|
|
@@ -278,8 +272,6 @@ export default {
|
278
|
272
|
* @param {Array} options.effects optional effects array for the track
|
279
|
273
|
* @param {boolean} options.firePermissionPromptIsShownEvent - if event
|
280
|
274
|
* JitsiMediaDevicesEvents.PERMISSION_PROMPT_IS_SHOWN should be fired
|
281
|
|
- * @param {boolean} options.fireSlowPromiseEvent - if event
|
282
|
|
- * JitsiMediaDevicesEvents.USER_MEDIA_SLOW_PROMISE_TIMEOUT should be fired
|
283
|
275
|
* @param {Array} options.devices the devices that will be requested
|
284
|
276
|
* @param {string} options.resolution resolution constraints
|
285
|
277
|
* @param {string} options.cameraDeviceId
|
|
@@ -290,18 +282,11 @@ export default {
|
290
|
282
|
* JitsiConferenceError if rejected.
|
291
|
283
|
*/
|
292
|
284
|
createLocalTracks(options: ICreateLocalTrackOptions = {}) {
|
293
|
|
- let promiseFulfilled = false;
|
294
|
|
- const { firePermissionPromptIsShownEvent, fireSlowPromiseEvent, ...restOptions } = options;
|
|
285
|
+ const { firePermissionPromptIsShownEvent, ...restOptions } = options;
|
295
|
286
|
|
296
|
287
|
if (firePermissionPromptIsShownEvent && !RTC.arePermissionsGrantedForAvailableDevices()) {
|
297
|
288
|
// @ts-ignore
|
298
|
289
|
JitsiMediaDevices.emit(JitsiMediaDevicesEvents.PERMISSION_PROMPT_IS_SHOWN, browser.getName());
|
299
|
|
- } else if (fireSlowPromiseEvent) {
|
300
|
|
- window.setTimeout(() => {
|
301
|
|
- if (!promiseFulfilled) {
|
302
|
|
- JitsiMediaDevices.emit(JitsiMediaDevicesEvents.SLOW_GET_USER_MEDIA);
|
303
|
|
- }
|
304
|
|
- }, USER_MEDIA_SLOW_PROMISE_TIMEOUT);
|
305
|
290
|
}
|
306
|
291
|
|
307
|
292
|
let isFirstGUM = false;
|
|
@@ -320,8 +305,6 @@ export default {
|
320
|
305
|
|
321
|
306
|
return RTC.obtainAudioAndVideoPermissions(restOptions)
|
322
|
307
|
.then(tracks => {
|
323
|
|
- promiseFulfilled = true;
|
324
|
|
-
|
325
|
308
|
let endTS = window.performance.now();
|
326
|
309
|
|
327
|
310
|
window.connectionTimes['obtainPermissions.end'] = endTS;
|
|
@@ -362,8 +345,6 @@ export default {
|
362
|
345
|
return tracks;
|
363
|
346
|
})
|
364
|
347
|
.catch(error => {
|
365
|
|
- promiseFulfilled = true;
|
366
|
|
-
|
367
|
348
|
if (error.name === JitsiTrackErrors.SCREENSHARING_USER_CANCELED) {
|
368
|
349
|
Statistics.sendAnalytics(
|
369
|
350
|
createGetUserMediaEvent(
|