@webex/internal-media-core 2.2.6 → 2.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +288 -1316
- package/dist/esm/index.js +289 -1316
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -29,1303 +29,6 @@ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_definePropert
|
|
|
29
29
|
var _classPrivateFieldGet__default = /*#__PURE__*/_interopDefaultLegacy(_classPrivateFieldGet);
|
|
30
30
|
var _classPrivateFieldSet__default = /*#__PURE__*/_interopDefaultLegacy(_classPrivateFieldSet);
|
|
31
31
|
|
|
32
|
-
var global$1 = (typeof global !== "undefined" ? global :
|
|
33
|
-
typeof self !== "undefined" ? self :
|
|
34
|
-
typeof window !== "undefined" ? window : {});
|
|
35
|
-
|
|
36
|
-
// shim for using process in browser
|
|
37
|
-
// based off https://github.com/defunctzombie/node-process/blob/master/browser.js
|
|
38
|
-
|
|
39
|
-
function defaultSetTimout() {
|
|
40
|
-
throw new Error('setTimeout has not been defined');
|
|
41
|
-
}
|
|
42
|
-
function defaultClearTimeout () {
|
|
43
|
-
throw new Error('clearTimeout has not been defined');
|
|
44
|
-
}
|
|
45
|
-
var cachedSetTimeout = defaultSetTimout;
|
|
46
|
-
var cachedClearTimeout = defaultClearTimeout;
|
|
47
|
-
if (typeof global$1.setTimeout === 'function') {
|
|
48
|
-
cachedSetTimeout = setTimeout;
|
|
49
|
-
}
|
|
50
|
-
if (typeof global$1.clearTimeout === 'function') {
|
|
51
|
-
cachedClearTimeout = clearTimeout;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function runTimeout(fun) {
|
|
55
|
-
if (cachedSetTimeout === setTimeout) {
|
|
56
|
-
//normal enviroments in sane situations
|
|
57
|
-
return setTimeout(fun, 0);
|
|
58
|
-
}
|
|
59
|
-
// if setTimeout wasn't available but was latter defined
|
|
60
|
-
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
|
61
|
-
cachedSetTimeout = setTimeout;
|
|
62
|
-
return setTimeout(fun, 0);
|
|
63
|
-
}
|
|
64
|
-
try {
|
|
65
|
-
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
66
|
-
return cachedSetTimeout(fun, 0);
|
|
67
|
-
} catch(e){
|
|
68
|
-
try {
|
|
69
|
-
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
70
|
-
return cachedSetTimeout.call(null, fun, 0);
|
|
71
|
-
} catch(e){
|
|
72
|
-
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
|
73
|
-
return cachedSetTimeout.call(this, fun, 0);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
function runClearTimeout(marker) {
|
|
80
|
-
if (cachedClearTimeout === clearTimeout) {
|
|
81
|
-
//normal enviroments in sane situations
|
|
82
|
-
return clearTimeout(marker);
|
|
83
|
-
}
|
|
84
|
-
// if clearTimeout wasn't available but was latter defined
|
|
85
|
-
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
|
86
|
-
cachedClearTimeout = clearTimeout;
|
|
87
|
-
return clearTimeout(marker);
|
|
88
|
-
}
|
|
89
|
-
try {
|
|
90
|
-
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
91
|
-
return cachedClearTimeout(marker);
|
|
92
|
-
} catch (e){
|
|
93
|
-
try {
|
|
94
|
-
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
95
|
-
return cachedClearTimeout.call(null, marker);
|
|
96
|
-
} catch (e){
|
|
97
|
-
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
|
98
|
-
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
|
99
|
-
return cachedClearTimeout.call(this, marker);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
var queue$2 = [];
|
|
107
|
-
var draining = false;
|
|
108
|
-
var currentQueue;
|
|
109
|
-
var queueIndex = -1;
|
|
110
|
-
|
|
111
|
-
function cleanUpNextTick() {
|
|
112
|
-
if (!draining || !currentQueue) {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
draining = false;
|
|
116
|
-
if (currentQueue.length) {
|
|
117
|
-
queue$2 = currentQueue.concat(queue$2);
|
|
118
|
-
} else {
|
|
119
|
-
queueIndex = -1;
|
|
120
|
-
}
|
|
121
|
-
if (queue$2.length) {
|
|
122
|
-
drainQueue();
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function drainQueue() {
|
|
127
|
-
if (draining) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
var timeout = runTimeout(cleanUpNextTick);
|
|
131
|
-
draining = true;
|
|
132
|
-
|
|
133
|
-
var len = queue$2.length;
|
|
134
|
-
while(len) {
|
|
135
|
-
currentQueue = queue$2;
|
|
136
|
-
queue$2 = [];
|
|
137
|
-
while (++queueIndex < len) {
|
|
138
|
-
if (currentQueue) {
|
|
139
|
-
currentQueue[queueIndex].run();
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
queueIndex = -1;
|
|
143
|
-
len = queue$2.length;
|
|
144
|
-
}
|
|
145
|
-
currentQueue = null;
|
|
146
|
-
draining = false;
|
|
147
|
-
runClearTimeout(timeout);
|
|
148
|
-
}
|
|
149
|
-
function nextTick(fun) {
|
|
150
|
-
var args = new Array(arguments.length - 1);
|
|
151
|
-
if (arguments.length > 1) {
|
|
152
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
153
|
-
args[i - 1] = arguments[i];
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
queue$2.push(new Item(fun, args));
|
|
157
|
-
if (queue$2.length === 1 && !draining) {
|
|
158
|
-
runTimeout(drainQueue);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
// v8 likes predictible objects
|
|
162
|
-
function Item(fun, array) {
|
|
163
|
-
this.fun = fun;
|
|
164
|
-
this.array = array;
|
|
165
|
-
}
|
|
166
|
-
Item.prototype.run = function () {
|
|
167
|
-
this.fun.apply(null, this.array);
|
|
168
|
-
};
|
|
169
|
-
var title = 'browser';
|
|
170
|
-
var platform = 'browser';
|
|
171
|
-
var browser = true;
|
|
172
|
-
var env = {};
|
|
173
|
-
var argv = [];
|
|
174
|
-
var version = ''; // empty string to avoid regexp issues
|
|
175
|
-
var versions = {};
|
|
176
|
-
var release = {};
|
|
177
|
-
var config = {};
|
|
178
|
-
|
|
179
|
-
function noop() {}
|
|
180
|
-
|
|
181
|
-
var on$1 = noop;
|
|
182
|
-
var addListener = noop;
|
|
183
|
-
var once$4 = noop;
|
|
184
|
-
var off$1 = noop;
|
|
185
|
-
var removeListener = noop;
|
|
186
|
-
var removeAllListeners = noop;
|
|
187
|
-
var emit = noop;
|
|
188
|
-
|
|
189
|
-
function binding(name) {
|
|
190
|
-
throw new Error('process.binding is not supported');
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
function cwd () { return '/' }
|
|
194
|
-
function chdir (dir) {
|
|
195
|
-
throw new Error('process.chdir is not supported');
|
|
196
|
-
}function umask() { return 0; }
|
|
197
|
-
|
|
198
|
-
// from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
|
|
199
|
-
var performance$1 = global$1.performance || {};
|
|
200
|
-
var performanceNow =
|
|
201
|
-
performance$1.now ||
|
|
202
|
-
performance$1.mozNow ||
|
|
203
|
-
performance$1.msNow ||
|
|
204
|
-
performance$1.oNow ||
|
|
205
|
-
performance$1.webkitNow ||
|
|
206
|
-
function(){ return (new Date()).getTime() };
|
|
207
|
-
|
|
208
|
-
// generate timestamp or delta
|
|
209
|
-
// see http://nodejs.org/api/process.html#process_process_hrtime
|
|
210
|
-
function hrtime(previousTimestamp){
|
|
211
|
-
var clocktime = performanceNow.call(performance$1)*1e-3;
|
|
212
|
-
var seconds = Math.floor(clocktime);
|
|
213
|
-
var nanoseconds = Math.floor((clocktime%1)*1e9);
|
|
214
|
-
if (previousTimestamp) {
|
|
215
|
-
seconds = seconds - previousTimestamp[0];
|
|
216
|
-
nanoseconds = nanoseconds - previousTimestamp[1];
|
|
217
|
-
if (nanoseconds<0) {
|
|
218
|
-
seconds--;
|
|
219
|
-
nanoseconds += 1e9;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
return [seconds,nanoseconds]
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
var startTime = new Date();
|
|
226
|
-
function uptime() {
|
|
227
|
-
var currentTime = new Date();
|
|
228
|
-
var dif = currentTime - startTime;
|
|
229
|
-
return dif / 1000;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
var browser$1 = {
|
|
233
|
-
nextTick: nextTick,
|
|
234
|
-
title: title,
|
|
235
|
-
browser: browser,
|
|
236
|
-
env: env,
|
|
237
|
-
argv: argv,
|
|
238
|
-
version: version,
|
|
239
|
-
versions: versions,
|
|
240
|
-
on: on$1,
|
|
241
|
-
addListener: addListener,
|
|
242
|
-
once: once$4,
|
|
243
|
-
off: off$1,
|
|
244
|
-
removeListener: removeListener,
|
|
245
|
-
removeAllListeners: removeAllListeners,
|
|
246
|
-
emit: emit,
|
|
247
|
-
binding: binding,
|
|
248
|
-
cwd: cwd,
|
|
249
|
-
chdir: chdir,
|
|
250
|
-
umask: umask,
|
|
251
|
-
hrtime: hrtime,
|
|
252
|
-
platform: platform,
|
|
253
|
-
release: release,
|
|
254
|
-
config: config,
|
|
255
|
-
uptime: uptime
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
var commonjsGlobal$4 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
259
|
-
|
|
260
|
-
var DetectRTC = {exports: {}};
|
|
261
|
-
|
|
262
|
-
(function (module) {
|
|
263
|
-
|
|
264
|
-
// Last Updated On: 2020-08-12 11:18:41 AM UTC
|
|
265
|
-
|
|
266
|
-
// ________________
|
|
267
|
-
// DetectRTC v1.4.1
|
|
268
|
-
|
|
269
|
-
// Open-Sourced: https://github.com/muaz-khan/DetectRTC
|
|
270
|
-
|
|
271
|
-
// --------------------------------------------------
|
|
272
|
-
// Muaz Khan - www.MuazKhan.com
|
|
273
|
-
// MIT License - www.WebRTC-Experiment.com/licence
|
|
274
|
-
// --------------------------------------------------
|
|
275
|
-
(function () {
|
|
276
|
-
var browserFakeUserAgent = 'Fake/5.0 (FakeOS) AppleWebKit/123 (KHTML, like Gecko) Fake/12.3.4567.89 Fake/123.45';
|
|
277
|
-
var isNodejs = typeof browser$1 === 'object' && typeof browser$1.versions === 'object' && browser$1.versions.node && /*node-process*/!browser$1.browser;
|
|
278
|
-
if (isNodejs) {
|
|
279
|
-
var version = browser$1.versions.node.toString().replace('v', '');
|
|
280
|
-
browserFakeUserAgent = 'Nodejs/' + version + ' (NodeOS) AppleWebKit/' + version + ' (KHTML, like Gecko) Nodejs/' + version + ' Nodejs/' + version;
|
|
281
|
-
}
|
|
282
|
-
(function (that) {
|
|
283
|
-
if (typeof window !== 'undefined') {
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
if (typeof window === 'undefined' && typeof commonjsGlobal$4 !== 'undefined') {
|
|
287
|
-
commonjsGlobal$4.navigator = {
|
|
288
|
-
userAgent: browserFakeUserAgent,
|
|
289
|
-
getUserMedia: function getUserMedia() {}
|
|
290
|
-
};
|
|
291
|
-
|
|
292
|
-
/*global window:true */
|
|
293
|
-
that.window = commonjsGlobal$4;
|
|
294
|
-
}
|
|
295
|
-
if (typeof location === 'undefined') {
|
|
296
|
-
/*global location:true */
|
|
297
|
-
that.location = {
|
|
298
|
-
protocol: 'file:',
|
|
299
|
-
href: '',
|
|
300
|
-
hash: ''
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
if (typeof screen === 'undefined') {
|
|
304
|
-
/*global screen:true */
|
|
305
|
-
that.screen = {
|
|
306
|
-
width: 0,
|
|
307
|
-
height: 0
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
})(typeof commonjsGlobal$4 !== 'undefined' ? commonjsGlobal$4 : window);
|
|
311
|
-
|
|
312
|
-
/*global navigator:true */
|
|
313
|
-
var navigator = window.navigator;
|
|
314
|
-
if (typeof navigator !== 'undefined') {
|
|
315
|
-
if (typeof navigator.webkitGetUserMedia !== 'undefined') {
|
|
316
|
-
navigator.getUserMedia = navigator.webkitGetUserMedia;
|
|
317
|
-
}
|
|
318
|
-
if (typeof navigator.mozGetUserMedia !== 'undefined') {
|
|
319
|
-
navigator.getUserMedia = navigator.mozGetUserMedia;
|
|
320
|
-
}
|
|
321
|
-
} else {
|
|
322
|
-
navigator = {
|
|
323
|
-
getUserMedia: function getUserMedia() {},
|
|
324
|
-
userAgent: browserFakeUserAgent
|
|
325
|
-
};
|
|
326
|
-
}
|
|
327
|
-
var isMobileDevice = !!/Android|webOS|iPhone|iPad|iPod|BB10|BlackBerry|IEMobile|Opera Mini|Mobile|mobile/i.test(navigator.userAgent || '');
|
|
328
|
-
var isEdge = navigator.userAgent.indexOf('Edge') !== -1 && (!!navigator.msSaveOrOpenBlob || !!navigator.msSaveBlob);
|
|
329
|
-
var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
|
|
330
|
-
var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1 && 'netscape' in window && / rv:/.test(navigator.userAgent);
|
|
331
|
-
var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
332
|
-
var isChrome = !!window.chrome && !isOpera;
|
|
333
|
-
var isIE = typeof document !== 'undefined' && !!document.documentMode && !isEdge;
|
|
334
|
-
|
|
335
|
-
// this one can also be used:
|
|
336
|
-
// https://www.websocket.org/js/stuff.js (DetectBrowser.js)
|
|
337
|
-
|
|
338
|
-
function getBrowserInfo() {
|
|
339
|
-
navigator.appVersion;
|
|
340
|
-
var nAgt = navigator.userAgent;
|
|
341
|
-
var browserName = navigator.appName;
|
|
342
|
-
var fullVersion = '' + parseFloat(navigator.appVersion);
|
|
343
|
-
var majorVersion = parseInt(navigator.appVersion, 10);
|
|
344
|
-
var nameOffset, verOffset, ix;
|
|
345
|
-
|
|
346
|
-
// In Opera, the true version is after 'Opera' or after 'Version'
|
|
347
|
-
if (isOpera) {
|
|
348
|
-
browserName = 'Opera';
|
|
349
|
-
try {
|
|
350
|
-
fullVersion = navigator.userAgent.split('OPR/')[1].split(' ')[0];
|
|
351
|
-
majorVersion = fullVersion.split('.')[0];
|
|
352
|
-
} catch (e) {
|
|
353
|
-
fullVersion = '0.0.0.0';
|
|
354
|
-
majorVersion = 0;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
// In MSIE version <=10, the true version is after 'MSIE' in userAgent
|
|
358
|
-
// In IE 11, look for the string after 'rv:'
|
|
359
|
-
else if (isIE) {
|
|
360
|
-
verOffset = nAgt.indexOf('rv:');
|
|
361
|
-
if (verOffset > 0) {
|
|
362
|
-
//IE 11
|
|
363
|
-
fullVersion = nAgt.substring(verOffset + 3);
|
|
364
|
-
} else {
|
|
365
|
-
//IE 10 or earlier
|
|
366
|
-
verOffset = nAgt.indexOf('MSIE');
|
|
367
|
-
fullVersion = nAgt.substring(verOffset + 5);
|
|
368
|
-
}
|
|
369
|
-
browserName = 'IE';
|
|
370
|
-
}
|
|
371
|
-
// In Chrome, the true version is after 'Chrome'
|
|
372
|
-
else if (isChrome) {
|
|
373
|
-
verOffset = nAgt.indexOf('Chrome');
|
|
374
|
-
browserName = 'Chrome';
|
|
375
|
-
fullVersion = nAgt.substring(verOffset + 7);
|
|
376
|
-
}
|
|
377
|
-
// In Safari, the true version is after 'Safari' or after 'Version'
|
|
378
|
-
else if (isSafari) {
|
|
379
|
-
// both and safri and chrome has same userAgent
|
|
380
|
-
if (nAgt.indexOf('CriOS') !== -1) {
|
|
381
|
-
verOffset = nAgt.indexOf('CriOS');
|
|
382
|
-
browserName = 'Chrome';
|
|
383
|
-
fullVersion = nAgt.substring(verOffset + 6);
|
|
384
|
-
} else if (nAgt.indexOf('FxiOS') !== -1) {
|
|
385
|
-
verOffset = nAgt.indexOf('FxiOS');
|
|
386
|
-
browserName = 'Firefox';
|
|
387
|
-
fullVersion = nAgt.substring(verOffset + 6);
|
|
388
|
-
} else {
|
|
389
|
-
verOffset = nAgt.indexOf('Safari');
|
|
390
|
-
browserName = 'Safari';
|
|
391
|
-
fullVersion = nAgt.substring(verOffset + 7);
|
|
392
|
-
if ((verOffset = nAgt.indexOf('Version')) !== -1) {
|
|
393
|
-
fullVersion = nAgt.substring(verOffset + 8);
|
|
394
|
-
}
|
|
395
|
-
if (navigator.userAgent.indexOf('Version/') !== -1) {
|
|
396
|
-
fullVersion = navigator.userAgent.split('Version/')[1].split(' ')[0];
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
// In Firefox, the true version is after 'Firefox'
|
|
401
|
-
else if (isFirefox) {
|
|
402
|
-
verOffset = nAgt.indexOf('Firefox');
|
|
403
|
-
browserName = 'Firefox';
|
|
404
|
-
fullVersion = nAgt.substring(verOffset + 8);
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
// In most other browsers, 'name/version' is at the end of userAgent
|
|
408
|
-
else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf('/'))) {
|
|
409
|
-
browserName = nAgt.substring(nameOffset, verOffset);
|
|
410
|
-
fullVersion = nAgt.substring(verOffset + 1);
|
|
411
|
-
if (browserName.toLowerCase() === browserName.toUpperCase()) {
|
|
412
|
-
browserName = navigator.appName;
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
if (isEdge) {
|
|
416
|
-
browserName = 'Edge';
|
|
417
|
-
fullVersion = navigator.userAgent.split('Edge/')[1];
|
|
418
|
-
// fullVersion = parseInt(navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)[2], 10).toString();
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
// trim the fullVersion string at semicolon/space/bracket if present
|
|
422
|
-
if ((ix = fullVersion.search(/[; \)]/)) !== -1) {
|
|
423
|
-
fullVersion = fullVersion.substring(0, ix);
|
|
424
|
-
}
|
|
425
|
-
majorVersion = parseInt('' + fullVersion, 10);
|
|
426
|
-
if (isNaN(majorVersion)) {
|
|
427
|
-
fullVersion = '' + parseFloat(navigator.appVersion);
|
|
428
|
-
majorVersion = parseInt(navigator.appVersion, 10);
|
|
429
|
-
}
|
|
430
|
-
return {
|
|
431
|
-
fullVersion: fullVersion,
|
|
432
|
-
version: majorVersion,
|
|
433
|
-
name: browserName,
|
|
434
|
-
isPrivateBrowsing: false
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
// via: https://gist.github.com/cou929/7973956
|
|
439
|
-
|
|
440
|
-
function retry(isDone, next) {
|
|
441
|
-
var currentTrial = 0,
|
|
442
|
-
maxRetry = 50,
|
|
443
|
-
isTimeout = false;
|
|
444
|
-
var id = window.setInterval(function () {
|
|
445
|
-
if (isDone()) {
|
|
446
|
-
window.clearInterval(id);
|
|
447
|
-
next(isTimeout);
|
|
448
|
-
}
|
|
449
|
-
if (currentTrial++ > maxRetry) {
|
|
450
|
-
window.clearInterval(id);
|
|
451
|
-
isTimeout = true;
|
|
452
|
-
next(isTimeout);
|
|
453
|
-
}
|
|
454
|
-
}, 10);
|
|
455
|
-
}
|
|
456
|
-
function isIE10OrLater(userAgent) {
|
|
457
|
-
var ua = userAgent.toLowerCase();
|
|
458
|
-
if (ua.indexOf('msie') === 0 && ua.indexOf('trident') === 0) {
|
|
459
|
-
return false;
|
|
460
|
-
}
|
|
461
|
-
var match = /(?:msie|rv:)\s?([\d\.]+)/.exec(ua);
|
|
462
|
-
if (match && parseInt(match[1], 10) >= 10) {
|
|
463
|
-
return true;
|
|
464
|
-
}
|
|
465
|
-
return false;
|
|
466
|
-
}
|
|
467
|
-
function detectPrivateMode(callback) {
|
|
468
|
-
var isPrivate;
|
|
469
|
-
try {
|
|
470
|
-
if (window.webkitRequestFileSystem) {
|
|
471
|
-
window.webkitRequestFileSystem(window.TEMPORARY, 1, function () {
|
|
472
|
-
isPrivate = false;
|
|
473
|
-
}, function (e) {
|
|
474
|
-
isPrivate = true;
|
|
475
|
-
});
|
|
476
|
-
} else if (window.indexedDB && /Firefox/.test(window.navigator.userAgent)) {
|
|
477
|
-
var db;
|
|
478
|
-
try {
|
|
479
|
-
db = window.indexedDB.open('test');
|
|
480
|
-
db.onerror = function () {
|
|
481
|
-
return true;
|
|
482
|
-
};
|
|
483
|
-
} catch (e) {
|
|
484
|
-
isPrivate = true;
|
|
485
|
-
}
|
|
486
|
-
if (typeof isPrivate === 'undefined') {
|
|
487
|
-
retry(function isDone() {
|
|
488
|
-
return db.readyState === 'done' ? true : false;
|
|
489
|
-
}, function next(isTimeout) {
|
|
490
|
-
if (!isTimeout) {
|
|
491
|
-
isPrivate = db.result ? false : true;
|
|
492
|
-
}
|
|
493
|
-
});
|
|
494
|
-
}
|
|
495
|
-
} else if (isIE10OrLater(window.navigator.userAgent)) {
|
|
496
|
-
isPrivate = false;
|
|
497
|
-
try {
|
|
498
|
-
if (!window.indexedDB) {
|
|
499
|
-
isPrivate = true;
|
|
500
|
-
}
|
|
501
|
-
} catch (e) {
|
|
502
|
-
isPrivate = true;
|
|
503
|
-
}
|
|
504
|
-
} else if (window.localStorage && /Safari/.test(window.navigator.userAgent)) {
|
|
505
|
-
try {
|
|
506
|
-
window.localStorage.setItem('test', 1);
|
|
507
|
-
} catch (e) {
|
|
508
|
-
isPrivate = true;
|
|
509
|
-
}
|
|
510
|
-
if (typeof isPrivate === 'undefined') {
|
|
511
|
-
isPrivate = false;
|
|
512
|
-
window.localStorage.removeItem('test');
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
} catch (e) {
|
|
516
|
-
isPrivate = false;
|
|
517
|
-
}
|
|
518
|
-
retry(function isDone() {
|
|
519
|
-
return typeof isPrivate !== 'undefined' ? true : false;
|
|
520
|
-
}, function next(isTimeout) {
|
|
521
|
-
callback(isPrivate);
|
|
522
|
-
});
|
|
523
|
-
}
|
|
524
|
-
var isMobile = {
|
|
525
|
-
Android: function Android() {
|
|
526
|
-
return navigator.userAgent.match(/Android/i);
|
|
527
|
-
},
|
|
528
|
-
BlackBerry: function BlackBerry() {
|
|
529
|
-
return navigator.userAgent.match(/BlackBerry|BB10/i);
|
|
530
|
-
},
|
|
531
|
-
iOS: function iOS() {
|
|
532
|
-
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
|
|
533
|
-
},
|
|
534
|
-
Opera: function Opera() {
|
|
535
|
-
return navigator.userAgent.match(/Opera Mini/i);
|
|
536
|
-
},
|
|
537
|
-
Windows: function Windows() {
|
|
538
|
-
return navigator.userAgent.match(/IEMobile/i);
|
|
539
|
-
},
|
|
540
|
-
any: function any() {
|
|
541
|
-
return isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows();
|
|
542
|
-
},
|
|
543
|
-
getOsName: function getOsName() {
|
|
544
|
-
var osName = 'Unknown OS';
|
|
545
|
-
if (isMobile.Android()) {
|
|
546
|
-
osName = 'Android';
|
|
547
|
-
}
|
|
548
|
-
if (isMobile.BlackBerry()) {
|
|
549
|
-
osName = 'BlackBerry';
|
|
550
|
-
}
|
|
551
|
-
if (isMobile.iOS()) {
|
|
552
|
-
osName = 'iOS';
|
|
553
|
-
}
|
|
554
|
-
if (isMobile.Opera()) {
|
|
555
|
-
osName = 'Opera Mini';
|
|
556
|
-
}
|
|
557
|
-
if (isMobile.Windows()) {
|
|
558
|
-
osName = 'Windows';
|
|
559
|
-
}
|
|
560
|
-
return osName;
|
|
561
|
-
}
|
|
562
|
-
};
|
|
563
|
-
|
|
564
|
-
// via: http://jsfiddle.net/ChristianL/AVyND/
|
|
565
|
-
function detectDesktopOS() {
|
|
566
|
-
var unknown = '-';
|
|
567
|
-
var nVer = navigator.appVersion;
|
|
568
|
-
var nAgt = navigator.userAgent;
|
|
569
|
-
var os = unknown;
|
|
570
|
-
var clientStrings = [{
|
|
571
|
-
s: 'Chrome OS',
|
|
572
|
-
r: /CrOS/
|
|
573
|
-
}, {
|
|
574
|
-
s: 'Windows 10',
|
|
575
|
-
r: /(Windows 10.0|Windows NT 10.0)/
|
|
576
|
-
}, {
|
|
577
|
-
s: 'Windows 8.1',
|
|
578
|
-
r: /(Windows 8.1|Windows NT 6.3)/
|
|
579
|
-
}, {
|
|
580
|
-
s: 'Windows 8',
|
|
581
|
-
r: /(Windows 8|Windows NT 6.2)/
|
|
582
|
-
}, {
|
|
583
|
-
s: 'Windows 7',
|
|
584
|
-
r: /(Windows 7|Windows NT 6.1)/
|
|
585
|
-
}, {
|
|
586
|
-
s: 'Windows Vista',
|
|
587
|
-
r: /Windows NT 6.0/
|
|
588
|
-
}, {
|
|
589
|
-
s: 'Windows Server 2003',
|
|
590
|
-
r: /Windows NT 5.2/
|
|
591
|
-
}, {
|
|
592
|
-
s: 'Windows XP',
|
|
593
|
-
r: /(Windows NT 5.1|Windows XP)/
|
|
594
|
-
}, {
|
|
595
|
-
s: 'Windows 2000',
|
|
596
|
-
r: /(Windows NT 5.0|Windows 2000)/
|
|
597
|
-
}, {
|
|
598
|
-
s: 'Windows ME',
|
|
599
|
-
r: /(Win 9x 4.90|Windows ME)/
|
|
600
|
-
}, {
|
|
601
|
-
s: 'Windows 98',
|
|
602
|
-
r: /(Windows 98|Win98)/
|
|
603
|
-
}, {
|
|
604
|
-
s: 'Windows 95',
|
|
605
|
-
r: /(Windows 95|Win95|Windows_95)/
|
|
606
|
-
}, {
|
|
607
|
-
s: 'Windows NT 4.0',
|
|
608
|
-
r: /(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/
|
|
609
|
-
}, {
|
|
610
|
-
s: 'Windows CE',
|
|
611
|
-
r: /Windows CE/
|
|
612
|
-
}, {
|
|
613
|
-
s: 'Windows 3.11',
|
|
614
|
-
r: /Win16/
|
|
615
|
-
}, {
|
|
616
|
-
s: 'Android',
|
|
617
|
-
r: /Android/
|
|
618
|
-
}, {
|
|
619
|
-
s: 'Open BSD',
|
|
620
|
-
r: /OpenBSD/
|
|
621
|
-
}, {
|
|
622
|
-
s: 'Sun OS',
|
|
623
|
-
r: /SunOS/
|
|
624
|
-
}, {
|
|
625
|
-
s: 'Linux',
|
|
626
|
-
r: /(Linux|X11)/
|
|
627
|
-
}, {
|
|
628
|
-
s: 'iOS',
|
|
629
|
-
r: /(iPhone|iPad|iPod)/
|
|
630
|
-
}, {
|
|
631
|
-
s: 'Mac OS X',
|
|
632
|
-
r: /Mac OS X/
|
|
633
|
-
}, {
|
|
634
|
-
s: 'Mac OS',
|
|
635
|
-
r: /(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/
|
|
636
|
-
}, {
|
|
637
|
-
s: 'QNX',
|
|
638
|
-
r: /QNX/
|
|
639
|
-
}, {
|
|
640
|
-
s: 'UNIX',
|
|
641
|
-
r: /UNIX/
|
|
642
|
-
}, {
|
|
643
|
-
s: 'BeOS',
|
|
644
|
-
r: /BeOS/
|
|
645
|
-
}, {
|
|
646
|
-
s: 'OS/2',
|
|
647
|
-
r: /OS\/2/
|
|
648
|
-
}, {
|
|
649
|
-
s: 'Search Bot',
|
|
650
|
-
r: /(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/
|
|
651
|
-
}];
|
|
652
|
-
for (var i = 0, cs; cs = clientStrings[i]; i++) {
|
|
653
|
-
if (cs.r.test(nAgt)) {
|
|
654
|
-
os = cs.s;
|
|
655
|
-
break;
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
var osVersion = unknown;
|
|
659
|
-
if (/Windows/.test(os)) {
|
|
660
|
-
if (/Windows (.*)/.test(os)) {
|
|
661
|
-
osVersion = /Windows (.*)/.exec(os)[1];
|
|
662
|
-
}
|
|
663
|
-
os = 'Windows';
|
|
664
|
-
}
|
|
665
|
-
switch (os) {
|
|
666
|
-
case 'Mac OS X':
|
|
667
|
-
if (/Mac OS X (10[\.\_\d]+)/.test(nAgt)) {
|
|
668
|
-
osVersion = /Mac OS X (10[\.\_\d]+)/.exec(nAgt)[1];
|
|
669
|
-
}
|
|
670
|
-
break;
|
|
671
|
-
case 'Android':
|
|
672
|
-
if (/Android ([\.\_\d]+)/.test(nAgt)) {
|
|
673
|
-
osVersion = /Android ([\.\_\d]+)/.exec(nAgt)[1];
|
|
674
|
-
}
|
|
675
|
-
break;
|
|
676
|
-
case 'iOS':
|
|
677
|
-
if (/OS (\d+)_(\d+)_?(\d+)?/.test(nAgt)) {
|
|
678
|
-
osVersion = /OS (\d+)_(\d+)_?(\d+)?/.exec(nVer);
|
|
679
|
-
if (osVersion && osVersion.length > 3) {
|
|
680
|
-
osVersion = osVersion[1] + '.' + osVersion[2] + '.' + (osVersion[3] | 0);
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
break;
|
|
684
|
-
}
|
|
685
|
-
return {
|
|
686
|
-
osName: os,
|
|
687
|
-
osVersion: osVersion
|
|
688
|
-
};
|
|
689
|
-
}
|
|
690
|
-
var osName = 'Unknown OS';
|
|
691
|
-
var osVersion = 'Unknown OS Version';
|
|
692
|
-
function getAndroidVersion(ua) {
|
|
693
|
-
ua = (ua || navigator.userAgent).toLowerCase();
|
|
694
|
-
var match = ua.match(/android\s([0-9\.]*)/);
|
|
695
|
-
return match ? match[1] : false;
|
|
696
|
-
}
|
|
697
|
-
var osInfo = detectDesktopOS();
|
|
698
|
-
if (osInfo && osInfo.osName && osInfo.osName != '-') {
|
|
699
|
-
osName = osInfo.osName;
|
|
700
|
-
osVersion = osInfo.osVersion;
|
|
701
|
-
} else if (isMobile.any()) {
|
|
702
|
-
osName = isMobile.getOsName();
|
|
703
|
-
if (osName == 'Android') {
|
|
704
|
-
osVersion = getAndroidVersion();
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
var isNodejs = typeof browser$1 === 'object' && typeof browser$1.versions === 'object' && browser$1.versions.node;
|
|
708
|
-
if (osName === 'Unknown OS' && isNodejs) {
|
|
709
|
-
osName = 'Nodejs';
|
|
710
|
-
osVersion = browser$1.versions.node.toString().replace('v', '');
|
|
711
|
-
}
|
|
712
|
-
var isCanvasSupportsStreamCapturing = false;
|
|
713
|
-
var isVideoSupportsStreamCapturing = false;
|
|
714
|
-
['captureStream', 'mozCaptureStream', 'webkitCaptureStream'].forEach(function (item) {
|
|
715
|
-
if (typeof document === 'undefined' || typeof document.createElement !== 'function') {
|
|
716
|
-
return;
|
|
717
|
-
}
|
|
718
|
-
if (!isCanvasSupportsStreamCapturing && item in document.createElement('canvas')) {
|
|
719
|
-
isCanvasSupportsStreamCapturing = true;
|
|
720
|
-
}
|
|
721
|
-
if (!isVideoSupportsStreamCapturing && item in document.createElement('video')) {
|
|
722
|
-
isVideoSupportsStreamCapturing = true;
|
|
723
|
-
}
|
|
724
|
-
});
|
|
725
|
-
var regexIpv4Local = /^(192\.168\.|169\.254\.|10\.|172\.(1[6-9]|2\d|3[01]))/,
|
|
726
|
-
regexIpv4 = /([0-9]{1,3}(\.[0-9]{1,3}){3})/,
|
|
727
|
-
regexIpv6 = /[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7}/;
|
|
728
|
-
|
|
729
|
-
// via: https://github.com/diafygi/webrtc-ips
|
|
730
|
-
function DetectLocalIPAddress(callback, stream) {
|
|
731
|
-
if (!DetectRTC.isWebRTCSupported) {
|
|
732
|
-
return;
|
|
733
|
-
}
|
|
734
|
-
var isPublic = true,
|
|
735
|
-
isIpv4 = true;
|
|
736
|
-
getIPs(function (ip) {
|
|
737
|
-
if (!ip) {
|
|
738
|
-
callback(); // Pass nothing to tell that ICE-gathering-ended
|
|
739
|
-
} else if (ip.match(regexIpv4Local)) {
|
|
740
|
-
isPublic = false;
|
|
741
|
-
callback('Local: ' + ip, isPublic, isIpv4);
|
|
742
|
-
} else if (ip.match(regexIpv6)) {
|
|
743
|
-
//via https://ourcodeworld.com/articles/read/257/how-to-get-the-client-ip-address-with-javascript-only
|
|
744
|
-
isIpv4 = false;
|
|
745
|
-
callback('Public: ' + ip, isPublic, isIpv4);
|
|
746
|
-
} else {
|
|
747
|
-
callback('Public: ' + ip, isPublic, isIpv4);
|
|
748
|
-
}
|
|
749
|
-
}, stream);
|
|
750
|
-
}
|
|
751
|
-
function getIPs(callback, stream) {
|
|
752
|
-
if (typeof document === 'undefined' || typeof document.getElementById !== 'function') {
|
|
753
|
-
return;
|
|
754
|
-
}
|
|
755
|
-
var ipDuplicates = {};
|
|
756
|
-
var RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
|
|
757
|
-
if (!RTCPeerConnection) {
|
|
758
|
-
var iframe = document.getElementById('iframe');
|
|
759
|
-
if (!iframe) {
|
|
760
|
-
return;
|
|
761
|
-
}
|
|
762
|
-
var win = iframe.contentWindow;
|
|
763
|
-
RTCPeerConnection = win.RTCPeerConnection || win.mozRTCPeerConnection || win.webkitRTCPeerConnection;
|
|
764
|
-
}
|
|
765
|
-
if (!RTCPeerConnection) {
|
|
766
|
-
return;
|
|
767
|
-
}
|
|
768
|
-
var peerConfig = null;
|
|
769
|
-
if (DetectRTC.browser === 'Chrome' && DetectRTC.browser.version < 58) {
|
|
770
|
-
// todo: add support for older Opera
|
|
771
|
-
peerConfig = {
|
|
772
|
-
optional: [{
|
|
773
|
-
RtpDataChannels: true
|
|
774
|
-
}]
|
|
775
|
-
};
|
|
776
|
-
}
|
|
777
|
-
var servers = {
|
|
778
|
-
iceServers: [{
|
|
779
|
-
urls: 'stun:stun.l.google.com:19302'
|
|
780
|
-
}]
|
|
781
|
-
};
|
|
782
|
-
var pc = new RTCPeerConnection(servers, peerConfig);
|
|
783
|
-
if (stream) {
|
|
784
|
-
if (pc.addStream) {
|
|
785
|
-
pc.addStream(stream);
|
|
786
|
-
} else if (pc.addTrack && stream.getTracks()[0]) {
|
|
787
|
-
pc.addTrack(stream.getTracks()[0], stream);
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
function handleCandidate(candidate) {
|
|
791
|
-
if (!candidate) {
|
|
792
|
-
callback(); // Pass nothing to tell that ICE-gathering-ended
|
|
793
|
-
return;
|
|
794
|
-
}
|
|
795
|
-
var match = regexIpv4.exec(candidate);
|
|
796
|
-
if (!match) {
|
|
797
|
-
return;
|
|
798
|
-
}
|
|
799
|
-
var ipAddress = match[1];
|
|
800
|
-
var isPublic = candidate.match(regexIpv4Local),
|
|
801
|
-
isIpv4 = true;
|
|
802
|
-
if (ipDuplicates[ipAddress] === undefined) {
|
|
803
|
-
callback(ipAddress, isPublic, isIpv4);
|
|
804
|
-
}
|
|
805
|
-
ipDuplicates[ipAddress] = true;
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
// listen for candidate events
|
|
809
|
-
pc.onicecandidate = function (event) {
|
|
810
|
-
if (event.candidate && event.candidate.candidate) {
|
|
811
|
-
handleCandidate(event.candidate.candidate);
|
|
812
|
-
} else {
|
|
813
|
-
handleCandidate(); // Pass nothing to tell that ICE-gathering-ended
|
|
814
|
-
}
|
|
815
|
-
};
|
|
816
|
-
|
|
817
|
-
// create data channel
|
|
818
|
-
if (!stream) {
|
|
819
|
-
try {
|
|
820
|
-
pc.createDataChannel('sctp', {});
|
|
821
|
-
} catch (e) {}
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
// create an offer sdp
|
|
825
|
-
if (DetectRTC.isPromisesSupported) {
|
|
826
|
-
pc.createOffer().then(function (result) {
|
|
827
|
-
pc.setLocalDescription(result).then(afterCreateOffer);
|
|
828
|
-
});
|
|
829
|
-
} else {
|
|
830
|
-
pc.createOffer(function (result) {
|
|
831
|
-
pc.setLocalDescription(result, afterCreateOffer, function () {});
|
|
832
|
-
}, function () {});
|
|
833
|
-
}
|
|
834
|
-
function afterCreateOffer() {
|
|
835
|
-
var lines = pc.localDescription.sdp.split('\n');
|
|
836
|
-
lines.forEach(function (line) {
|
|
837
|
-
if (line && line.indexOf('a=candidate:') === 0) {
|
|
838
|
-
handleCandidate(line);
|
|
839
|
-
}
|
|
840
|
-
});
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
var MediaDevices = [];
|
|
844
|
-
var audioInputDevices = [];
|
|
845
|
-
var audioOutputDevices = [];
|
|
846
|
-
var videoInputDevices = [];
|
|
847
|
-
if (navigator.mediaDevices && navigator.mediaDevices.enumerateDevices) {
|
|
848
|
-
// Firefox 38+ seems having support of enumerateDevices
|
|
849
|
-
// Thanks @xdumaine/enumerateDevices
|
|
850
|
-
navigator.enumerateDevices = function (callback) {
|
|
851
|
-
var enumerateDevices = navigator.mediaDevices.enumerateDevices();
|
|
852
|
-
if (enumerateDevices && enumerateDevices.then) {
|
|
853
|
-
navigator.mediaDevices.enumerateDevices().then(callback).catch(function () {
|
|
854
|
-
callback([]);
|
|
855
|
-
});
|
|
856
|
-
} else {
|
|
857
|
-
callback([]);
|
|
858
|
-
}
|
|
859
|
-
};
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
// Media Devices detection
|
|
863
|
-
var canEnumerate = false;
|
|
864
|
-
|
|
865
|
-
/*global MediaStreamTrack:true */
|
|
866
|
-
if (typeof MediaStreamTrack !== 'undefined' && 'getSources' in MediaStreamTrack) {
|
|
867
|
-
canEnumerate = true;
|
|
868
|
-
} else if (navigator.mediaDevices && !!navigator.mediaDevices.enumerateDevices) {
|
|
869
|
-
canEnumerate = true;
|
|
870
|
-
}
|
|
871
|
-
var hasMicrophone = false;
|
|
872
|
-
var hasSpeakers = false;
|
|
873
|
-
var hasWebcam = false;
|
|
874
|
-
var isWebsiteHasMicrophonePermissions = false;
|
|
875
|
-
var isWebsiteHasWebcamPermissions = false;
|
|
876
|
-
|
|
877
|
-
// http://dev.w3.org/2011/webrtc/editor/getusermedia.html#mediadevices
|
|
878
|
-
function checkDeviceSupport(callback) {
|
|
879
|
-
if (!canEnumerate) {
|
|
880
|
-
if (callback) {
|
|
881
|
-
callback();
|
|
882
|
-
}
|
|
883
|
-
return;
|
|
884
|
-
}
|
|
885
|
-
if (!navigator.enumerateDevices && window.MediaStreamTrack && window.MediaStreamTrack.getSources) {
|
|
886
|
-
navigator.enumerateDevices = window.MediaStreamTrack.getSources.bind(window.MediaStreamTrack);
|
|
887
|
-
}
|
|
888
|
-
if (!navigator.enumerateDevices && navigator.enumerateDevices) {
|
|
889
|
-
navigator.enumerateDevices = navigator.enumerateDevices.bind(navigator);
|
|
890
|
-
}
|
|
891
|
-
if (!navigator.enumerateDevices) {
|
|
892
|
-
if (callback) {
|
|
893
|
-
callback();
|
|
894
|
-
}
|
|
895
|
-
return;
|
|
896
|
-
}
|
|
897
|
-
MediaDevices = [];
|
|
898
|
-
audioInputDevices = [];
|
|
899
|
-
audioOutputDevices = [];
|
|
900
|
-
videoInputDevices = [];
|
|
901
|
-
hasMicrophone = false;
|
|
902
|
-
hasSpeakers = false;
|
|
903
|
-
hasWebcam = false;
|
|
904
|
-
isWebsiteHasMicrophonePermissions = false;
|
|
905
|
-
isWebsiteHasWebcamPermissions = false;
|
|
906
|
-
|
|
907
|
-
// to prevent duplication
|
|
908
|
-
var alreadyUsedDevices = {};
|
|
909
|
-
navigator.enumerateDevices(function (devices) {
|
|
910
|
-
MediaDevices = [];
|
|
911
|
-
audioInputDevices = [];
|
|
912
|
-
audioOutputDevices = [];
|
|
913
|
-
videoInputDevices = [];
|
|
914
|
-
devices.forEach(function (_device) {
|
|
915
|
-
var device = {};
|
|
916
|
-
for (var d in _device) {
|
|
917
|
-
try {
|
|
918
|
-
if (typeof _device[d] !== 'function') {
|
|
919
|
-
device[d] = _device[d];
|
|
920
|
-
}
|
|
921
|
-
} catch (e) {}
|
|
922
|
-
}
|
|
923
|
-
if (alreadyUsedDevices[device.deviceId + device.label + device.kind]) {
|
|
924
|
-
return;
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
// if it is MediaStreamTrack.getSources
|
|
928
|
-
if (device.kind === 'audio') {
|
|
929
|
-
device.kind = 'audioinput';
|
|
930
|
-
}
|
|
931
|
-
if (device.kind === 'video') {
|
|
932
|
-
device.kind = 'videoinput';
|
|
933
|
-
}
|
|
934
|
-
if (!device.deviceId) {
|
|
935
|
-
device.deviceId = device.id;
|
|
936
|
-
}
|
|
937
|
-
if (!device.id) {
|
|
938
|
-
device.id = device.deviceId;
|
|
939
|
-
}
|
|
940
|
-
if (!device.label) {
|
|
941
|
-
device.isCustomLabel = true;
|
|
942
|
-
if (device.kind === 'videoinput') {
|
|
943
|
-
device.label = 'Camera ' + (videoInputDevices.length + 1);
|
|
944
|
-
} else if (device.kind === 'audioinput') {
|
|
945
|
-
device.label = 'Microphone ' + (audioInputDevices.length + 1);
|
|
946
|
-
} else if (device.kind === 'audiooutput') {
|
|
947
|
-
device.label = 'Speaker ' + (audioOutputDevices.length + 1);
|
|
948
|
-
} else {
|
|
949
|
-
device.label = 'Please invoke getUserMedia once.';
|
|
950
|
-
}
|
|
951
|
-
if (typeof DetectRTC !== 'undefined' && DetectRTC.browser.isChrome && DetectRTC.browser.version >= 46 && !/^(https:|chrome-extension:)$/g.test(location.protocol || '')) {
|
|
952
|
-
if (typeof document !== 'undefined' && typeof document.domain === 'string' && document.domain.search && document.domain.search(/localhost|127.0./g) === -1) {
|
|
953
|
-
device.label = 'HTTPs is required to get label of this ' + device.kind + ' device.';
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
} else {
|
|
957
|
-
// Firefox on Android still returns empty label
|
|
958
|
-
if (device.kind === 'videoinput' && !isWebsiteHasWebcamPermissions) {
|
|
959
|
-
isWebsiteHasWebcamPermissions = true;
|
|
960
|
-
}
|
|
961
|
-
if (device.kind === 'audioinput' && !isWebsiteHasMicrophonePermissions) {
|
|
962
|
-
isWebsiteHasMicrophonePermissions = true;
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
if (device.kind === 'audioinput') {
|
|
966
|
-
hasMicrophone = true;
|
|
967
|
-
if (audioInputDevices.indexOf(device) === -1) {
|
|
968
|
-
audioInputDevices.push(device);
|
|
969
|
-
}
|
|
970
|
-
}
|
|
971
|
-
if (device.kind === 'audiooutput') {
|
|
972
|
-
hasSpeakers = true;
|
|
973
|
-
if (audioOutputDevices.indexOf(device) === -1) {
|
|
974
|
-
audioOutputDevices.push(device);
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
if (device.kind === 'videoinput') {
|
|
978
|
-
hasWebcam = true;
|
|
979
|
-
if (videoInputDevices.indexOf(device) === -1) {
|
|
980
|
-
videoInputDevices.push(device);
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
// there is no 'videoouput' in the spec.
|
|
985
|
-
MediaDevices.push(device);
|
|
986
|
-
alreadyUsedDevices[device.deviceId + device.label + device.kind] = device;
|
|
987
|
-
});
|
|
988
|
-
if (typeof DetectRTC !== 'undefined') {
|
|
989
|
-
// to sync latest outputs
|
|
990
|
-
DetectRTC.MediaDevices = MediaDevices;
|
|
991
|
-
DetectRTC.hasMicrophone = hasMicrophone;
|
|
992
|
-
DetectRTC.hasSpeakers = hasSpeakers;
|
|
993
|
-
DetectRTC.hasWebcam = hasWebcam;
|
|
994
|
-
DetectRTC.isWebsiteHasWebcamPermissions = isWebsiteHasWebcamPermissions;
|
|
995
|
-
DetectRTC.isWebsiteHasMicrophonePermissions = isWebsiteHasMicrophonePermissions;
|
|
996
|
-
DetectRTC.audioInputDevices = audioInputDevices;
|
|
997
|
-
DetectRTC.audioOutputDevices = audioOutputDevices;
|
|
998
|
-
DetectRTC.videoInputDevices = videoInputDevices;
|
|
999
|
-
}
|
|
1000
|
-
if (callback) {
|
|
1001
|
-
callback();
|
|
1002
|
-
}
|
|
1003
|
-
});
|
|
1004
|
-
}
|
|
1005
|
-
var DetectRTC = window.DetectRTC || {};
|
|
1006
|
-
|
|
1007
|
-
// ----------
|
|
1008
|
-
// DetectRTC.browser.name || DetectRTC.browser.version || DetectRTC.browser.fullVersion
|
|
1009
|
-
DetectRTC.browser = getBrowserInfo();
|
|
1010
|
-
detectPrivateMode(function (isPrivateBrowsing) {
|
|
1011
|
-
DetectRTC.browser.isPrivateBrowsing = !!isPrivateBrowsing;
|
|
1012
|
-
});
|
|
1013
|
-
|
|
1014
|
-
// DetectRTC.isChrome || DetectRTC.isFirefox || DetectRTC.isEdge
|
|
1015
|
-
DetectRTC.browser['is' + DetectRTC.browser.name] = true;
|
|
1016
|
-
|
|
1017
|
-
// -----------
|
|
1018
|
-
DetectRTC.osName = osName;
|
|
1019
|
-
DetectRTC.osVersion = osVersion;
|
|
1020
|
-
typeof browser$1 === 'object' && typeof browser$1.versions === 'object' && browser$1.versions['node-webkit'];
|
|
1021
|
-
|
|
1022
|
-
// --------- Detect if system supports WebRTC 1.0 or WebRTC 1.1.
|
|
1023
|
-
var isWebRTCSupported = false;
|
|
1024
|
-
['RTCPeerConnection', 'webkitRTCPeerConnection', 'mozRTCPeerConnection', 'RTCIceGatherer'].forEach(function (item) {
|
|
1025
|
-
if (isWebRTCSupported) {
|
|
1026
|
-
return;
|
|
1027
|
-
}
|
|
1028
|
-
if (item in window) {
|
|
1029
|
-
isWebRTCSupported = true;
|
|
1030
|
-
}
|
|
1031
|
-
});
|
|
1032
|
-
DetectRTC.isWebRTCSupported = isWebRTCSupported;
|
|
1033
|
-
|
|
1034
|
-
//-------
|
|
1035
|
-
DetectRTC.isORTCSupported = typeof RTCIceGatherer !== 'undefined';
|
|
1036
|
-
|
|
1037
|
-
// --------- Detect if system supports screen capturing API
|
|
1038
|
-
var isScreenCapturingSupported = false;
|
|
1039
|
-
if (DetectRTC.browser.isChrome && DetectRTC.browser.version >= 35) {
|
|
1040
|
-
isScreenCapturingSupported = true;
|
|
1041
|
-
} else if (DetectRTC.browser.isFirefox && DetectRTC.browser.version >= 34) {
|
|
1042
|
-
isScreenCapturingSupported = true;
|
|
1043
|
-
} else if (DetectRTC.browser.isEdge && DetectRTC.browser.version >= 17) {
|
|
1044
|
-
isScreenCapturingSupported = true;
|
|
1045
|
-
} else if (DetectRTC.osName === 'Android' && DetectRTC.browser.isChrome) {
|
|
1046
|
-
isScreenCapturingSupported = true;
|
|
1047
|
-
}
|
|
1048
|
-
if (!!navigator.getDisplayMedia || navigator.mediaDevices && navigator.mediaDevices.getDisplayMedia) {
|
|
1049
|
-
isScreenCapturingSupported = true;
|
|
1050
|
-
}
|
|
1051
|
-
if (!/^(https:|chrome-extension:)$/g.test(location.protocol || '')) {
|
|
1052
|
-
var isNonLocalHost = typeof document !== 'undefined' && typeof document.domain === 'string' && document.domain.search && document.domain.search(/localhost|127.0./g) === -1;
|
|
1053
|
-
if (isNonLocalHost && (DetectRTC.browser.isChrome || DetectRTC.browser.isEdge || DetectRTC.browser.isOpera)) {
|
|
1054
|
-
isScreenCapturingSupported = false;
|
|
1055
|
-
} else if (DetectRTC.browser.isFirefox) {
|
|
1056
|
-
isScreenCapturingSupported = false;
|
|
1057
|
-
}
|
|
1058
|
-
}
|
|
1059
|
-
DetectRTC.isScreenCapturingSupported = isScreenCapturingSupported;
|
|
1060
|
-
|
|
1061
|
-
// --------- Detect if WebAudio API are supported
|
|
1062
|
-
var webAudio = {
|
|
1063
|
-
isSupported: false,
|
|
1064
|
-
isCreateMediaStreamSourceSupported: false
|
|
1065
|
-
};
|
|
1066
|
-
['AudioContext', 'webkitAudioContext', 'mozAudioContext', 'msAudioContext'].forEach(function (item) {
|
|
1067
|
-
if (webAudio.isSupported) {
|
|
1068
|
-
return;
|
|
1069
|
-
}
|
|
1070
|
-
if (item in window) {
|
|
1071
|
-
webAudio.isSupported = true;
|
|
1072
|
-
if (window[item] && 'createMediaStreamSource' in window[item].prototype) {
|
|
1073
|
-
webAudio.isCreateMediaStreamSourceSupported = true;
|
|
1074
|
-
}
|
|
1075
|
-
}
|
|
1076
|
-
});
|
|
1077
|
-
DetectRTC.isAudioContextSupported = webAudio.isSupported;
|
|
1078
|
-
DetectRTC.isCreateMediaStreamSourceSupported = webAudio.isCreateMediaStreamSourceSupported;
|
|
1079
|
-
|
|
1080
|
-
// ---------- Detect if SCTP/RTP channels are supported.
|
|
1081
|
-
|
|
1082
|
-
var isRtpDataChannelsSupported = false;
|
|
1083
|
-
if (DetectRTC.browser.isChrome && DetectRTC.browser.version > 31) {
|
|
1084
|
-
isRtpDataChannelsSupported = true;
|
|
1085
|
-
}
|
|
1086
|
-
DetectRTC.isRtpDataChannelsSupported = isRtpDataChannelsSupported;
|
|
1087
|
-
var isSCTPSupportd = false;
|
|
1088
|
-
if (DetectRTC.browser.isFirefox && DetectRTC.browser.version > 28) {
|
|
1089
|
-
isSCTPSupportd = true;
|
|
1090
|
-
} else if (DetectRTC.browser.isChrome && DetectRTC.browser.version > 25) {
|
|
1091
|
-
isSCTPSupportd = true;
|
|
1092
|
-
} else if (DetectRTC.browser.isOpera && DetectRTC.browser.version >= 11) {
|
|
1093
|
-
isSCTPSupportd = true;
|
|
1094
|
-
}
|
|
1095
|
-
DetectRTC.isSctpDataChannelsSupported = isSCTPSupportd;
|
|
1096
|
-
|
|
1097
|
-
// ---------
|
|
1098
|
-
|
|
1099
|
-
DetectRTC.isMobileDevice = isMobileDevice; // "isMobileDevice" boolean is defined in "getBrowserInfo.js"
|
|
1100
|
-
|
|
1101
|
-
// ------
|
|
1102
|
-
var isGetUserMediaSupported = false;
|
|
1103
|
-
if (navigator.getUserMedia) {
|
|
1104
|
-
isGetUserMediaSupported = true;
|
|
1105
|
-
} else if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
|
|
1106
|
-
isGetUserMediaSupported = true;
|
|
1107
|
-
}
|
|
1108
|
-
if (DetectRTC.browser.isChrome && DetectRTC.browser.version >= 46 && !/^(https:|chrome-extension:)$/g.test(location.protocol || '')) {
|
|
1109
|
-
if (typeof document !== 'undefined' && typeof document.domain === 'string' && document.domain.search && document.domain.search(/localhost|127.0./g) === -1) {
|
|
1110
|
-
isGetUserMediaSupported = 'Requires HTTPs';
|
|
1111
|
-
}
|
|
1112
|
-
}
|
|
1113
|
-
if (DetectRTC.osName === 'Nodejs') {
|
|
1114
|
-
isGetUserMediaSupported = false;
|
|
1115
|
-
}
|
|
1116
|
-
DetectRTC.isGetUserMediaSupported = isGetUserMediaSupported;
|
|
1117
|
-
var displayResolution = '';
|
|
1118
|
-
if (screen.width) {
|
|
1119
|
-
var width = screen.width ? screen.width : '';
|
|
1120
|
-
var height = screen.height ? screen.height : '';
|
|
1121
|
-
displayResolution += '' + width + ' x ' + height;
|
|
1122
|
-
}
|
|
1123
|
-
DetectRTC.displayResolution = displayResolution;
|
|
1124
|
-
function getAspectRatio(w, h) {
|
|
1125
|
-
function gcd(a, b) {
|
|
1126
|
-
return b == 0 ? a : gcd(b, a % b);
|
|
1127
|
-
}
|
|
1128
|
-
var r = gcd(w, h);
|
|
1129
|
-
return w / r / (h / r);
|
|
1130
|
-
}
|
|
1131
|
-
DetectRTC.displayAspectRatio = getAspectRatio(screen.width, screen.height).toFixed(2);
|
|
1132
|
-
|
|
1133
|
-
// ----------
|
|
1134
|
-
DetectRTC.isCanvasSupportsStreamCapturing = isCanvasSupportsStreamCapturing;
|
|
1135
|
-
DetectRTC.isVideoSupportsStreamCapturing = isVideoSupportsStreamCapturing;
|
|
1136
|
-
if (DetectRTC.browser.name == 'Chrome' && DetectRTC.browser.version >= 53) {
|
|
1137
|
-
if (!DetectRTC.isCanvasSupportsStreamCapturing) {
|
|
1138
|
-
DetectRTC.isCanvasSupportsStreamCapturing = 'Requires chrome flag: enable-experimental-web-platform-features';
|
|
1139
|
-
}
|
|
1140
|
-
if (!DetectRTC.isVideoSupportsStreamCapturing) {
|
|
1141
|
-
DetectRTC.isVideoSupportsStreamCapturing = 'Requires chrome flag: enable-experimental-web-platform-features';
|
|
1142
|
-
}
|
|
1143
|
-
}
|
|
1144
|
-
|
|
1145
|
-
// ------
|
|
1146
|
-
DetectRTC.DetectLocalIPAddress = DetectLocalIPAddress;
|
|
1147
|
-
DetectRTC.isWebSocketsSupported = 'WebSocket' in window && 2 === window.WebSocket.CLOSING;
|
|
1148
|
-
DetectRTC.isWebSocketsBlocked = !DetectRTC.isWebSocketsSupported;
|
|
1149
|
-
if (DetectRTC.osName === 'Nodejs') {
|
|
1150
|
-
DetectRTC.isWebSocketsSupported = true;
|
|
1151
|
-
DetectRTC.isWebSocketsBlocked = false;
|
|
1152
|
-
}
|
|
1153
|
-
DetectRTC.checkWebSocketsSupport = function (callback) {
|
|
1154
|
-
callback = callback || function () {};
|
|
1155
|
-
try {
|
|
1156
|
-
var starttime;
|
|
1157
|
-
var websocket = new WebSocket('wss://echo.websocket.org:443/');
|
|
1158
|
-
websocket.onopen = function () {
|
|
1159
|
-
DetectRTC.isWebSocketsBlocked = false;
|
|
1160
|
-
starttime = new Date().getTime();
|
|
1161
|
-
websocket.send('ping');
|
|
1162
|
-
};
|
|
1163
|
-
websocket.onmessage = function () {
|
|
1164
|
-
DetectRTC.WebsocketLatency = new Date().getTime() - starttime + 'ms';
|
|
1165
|
-
callback();
|
|
1166
|
-
websocket.close();
|
|
1167
|
-
websocket = null;
|
|
1168
|
-
};
|
|
1169
|
-
websocket.onerror = function () {
|
|
1170
|
-
DetectRTC.isWebSocketsBlocked = true;
|
|
1171
|
-
callback();
|
|
1172
|
-
};
|
|
1173
|
-
} catch (e) {
|
|
1174
|
-
DetectRTC.isWebSocketsBlocked = true;
|
|
1175
|
-
callback();
|
|
1176
|
-
}
|
|
1177
|
-
};
|
|
1178
|
-
|
|
1179
|
-
// -------
|
|
1180
|
-
DetectRTC.load = function (callback) {
|
|
1181
|
-
callback = callback || function () {};
|
|
1182
|
-
checkDeviceSupport(callback);
|
|
1183
|
-
};
|
|
1184
|
-
if (typeof MediaDevices !== 'undefined') {
|
|
1185
|
-
DetectRTC.MediaDevices = MediaDevices;
|
|
1186
|
-
} else {
|
|
1187
|
-
DetectRTC.MediaDevices = [];
|
|
1188
|
-
}
|
|
1189
|
-
DetectRTC.hasMicrophone = hasMicrophone;
|
|
1190
|
-
DetectRTC.hasSpeakers = hasSpeakers;
|
|
1191
|
-
DetectRTC.hasWebcam = hasWebcam;
|
|
1192
|
-
DetectRTC.isWebsiteHasWebcamPermissions = isWebsiteHasWebcamPermissions;
|
|
1193
|
-
DetectRTC.isWebsiteHasMicrophonePermissions = isWebsiteHasMicrophonePermissions;
|
|
1194
|
-
DetectRTC.audioInputDevices = audioInputDevices;
|
|
1195
|
-
DetectRTC.audioOutputDevices = audioOutputDevices;
|
|
1196
|
-
DetectRTC.videoInputDevices = videoInputDevices;
|
|
1197
|
-
|
|
1198
|
-
// ------
|
|
1199
|
-
var isSetSinkIdSupported = false;
|
|
1200
|
-
if (typeof document !== 'undefined' && typeof document.createElement === 'function' && 'setSinkId' in document.createElement('video')) {
|
|
1201
|
-
isSetSinkIdSupported = true;
|
|
1202
|
-
}
|
|
1203
|
-
DetectRTC.isSetSinkIdSupported = isSetSinkIdSupported;
|
|
1204
|
-
|
|
1205
|
-
// -----
|
|
1206
|
-
var isRTPSenderReplaceTracksSupported = false;
|
|
1207
|
-
if (DetectRTC.browser.isFirefox && typeof mozRTCPeerConnection !== 'undefined' /*&& DetectRTC.browser.version > 39*/) {
|
|
1208
|
-
/*global mozRTCPeerConnection:true */
|
|
1209
|
-
if ('getSenders' in mozRTCPeerConnection.prototype) {
|
|
1210
|
-
isRTPSenderReplaceTracksSupported = true;
|
|
1211
|
-
}
|
|
1212
|
-
} else if (DetectRTC.browser.isChrome && typeof webkitRTCPeerConnection !== 'undefined') {
|
|
1213
|
-
/*global webkitRTCPeerConnection:true */
|
|
1214
|
-
if ('getSenders' in webkitRTCPeerConnection.prototype) {
|
|
1215
|
-
isRTPSenderReplaceTracksSupported = true;
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
DetectRTC.isRTPSenderReplaceTracksSupported = isRTPSenderReplaceTracksSupported;
|
|
1219
|
-
|
|
1220
|
-
//------
|
|
1221
|
-
var isRemoteStreamProcessingSupported = false;
|
|
1222
|
-
if (DetectRTC.browser.isFirefox && DetectRTC.browser.version > 38) {
|
|
1223
|
-
isRemoteStreamProcessingSupported = true;
|
|
1224
|
-
}
|
|
1225
|
-
DetectRTC.isRemoteStreamProcessingSupported = isRemoteStreamProcessingSupported;
|
|
1226
|
-
|
|
1227
|
-
//-------
|
|
1228
|
-
var isApplyConstraintsSupported = false;
|
|
1229
|
-
|
|
1230
|
-
/*global MediaStreamTrack:true */
|
|
1231
|
-
if (typeof MediaStreamTrack !== 'undefined' && 'applyConstraints' in MediaStreamTrack.prototype) {
|
|
1232
|
-
isApplyConstraintsSupported = true;
|
|
1233
|
-
}
|
|
1234
|
-
DetectRTC.isApplyConstraintsSupported = isApplyConstraintsSupported;
|
|
1235
|
-
|
|
1236
|
-
//-------
|
|
1237
|
-
var isMultiMonitorScreenCapturingSupported = false;
|
|
1238
|
-
if (DetectRTC.browser.isFirefox && DetectRTC.browser.version >= 43) {
|
|
1239
|
-
// version 43 merely supports platforms for multi-monitors
|
|
1240
|
-
// version 44 will support exact multi-monitor selection i.e. you can select any monitor for screen capturing.
|
|
1241
|
-
isMultiMonitorScreenCapturingSupported = true;
|
|
1242
|
-
}
|
|
1243
|
-
DetectRTC.isMultiMonitorScreenCapturingSupported = isMultiMonitorScreenCapturingSupported;
|
|
1244
|
-
DetectRTC.isPromisesSupported = !!('Promise' in window);
|
|
1245
|
-
|
|
1246
|
-
// version is generated by "grunt"
|
|
1247
|
-
DetectRTC.version = '1.4.1';
|
|
1248
|
-
if (typeof DetectRTC === 'undefined') {
|
|
1249
|
-
window.DetectRTC = {};
|
|
1250
|
-
}
|
|
1251
|
-
var MediaStream = window.MediaStream;
|
|
1252
|
-
if (typeof MediaStream === 'undefined' && typeof webkitMediaStream !== 'undefined') {
|
|
1253
|
-
MediaStream = webkitMediaStream;
|
|
1254
|
-
}
|
|
1255
|
-
if (typeof MediaStream !== 'undefined' && typeof MediaStream === 'function') {
|
|
1256
|
-
DetectRTC.MediaStream = Object.keys(MediaStream.prototype);
|
|
1257
|
-
} else DetectRTC.MediaStream = false;
|
|
1258
|
-
if (typeof MediaStreamTrack !== 'undefined') {
|
|
1259
|
-
DetectRTC.MediaStreamTrack = Object.keys(MediaStreamTrack.prototype);
|
|
1260
|
-
} else DetectRTC.MediaStreamTrack = false;
|
|
1261
|
-
var RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
|
|
1262
|
-
if (typeof RTCPeerConnection !== 'undefined') {
|
|
1263
|
-
DetectRTC.RTCPeerConnection = Object.keys(RTCPeerConnection.prototype);
|
|
1264
|
-
} else DetectRTC.RTCPeerConnection = false;
|
|
1265
|
-
window.DetectRTC = DetectRTC;
|
|
1266
|
-
{
|
|
1267
|
-
module.exports = DetectRTC;
|
|
1268
|
-
}
|
|
1269
|
-
})();
|
|
1270
|
-
})(DetectRTC);
|
|
1271
|
-
|
|
1272
|
-
var MEDIA = 'MEDIA';
|
|
1273
|
-
var DEVICE = 'DEVICE';
|
|
1274
|
-
var MEDIA_STREAM_TRACK = 'MEDIA_STREAM_TRACK';
|
|
1275
|
-
|
|
1276
|
-
var LEVELS = {
|
|
1277
|
-
error: 1,
|
|
1278
|
-
warn: 2,
|
|
1279
|
-
info: 3,
|
|
1280
|
-
debug: 4
|
|
1281
|
-
};
|
|
1282
|
-
var logFormat = (level, logDetails) => {
|
|
1283
|
-
var {
|
|
1284
|
-
ID,
|
|
1285
|
-
mediaType,
|
|
1286
|
-
action,
|
|
1287
|
-
description,
|
|
1288
|
-
error
|
|
1289
|
-
} = logDetails;
|
|
1290
|
-
var timestamp = new Date().toISOString();
|
|
1291
|
-
var errorText = error ? error.stack ? "".concat(error.message, ": ").concat(error.stack) : "".concat(error) : '';
|
|
1292
|
-
return "".concat(timestamp, " ").concat(level, " ").concat(ID || '', " ").concat(mediaType, " ").concat(action, " ").concat(description, " ").concat(errorText).replace(/\s+/g, ' ').trim();
|
|
1293
|
-
};
|
|
1294
|
-
var currentLevel = 'error';
|
|
1295
|
-
var log$3 = (level, args) => {
|
|
1296
|
-
if (LEVELS[level] <= LEVELS[currentLevel]) {
|
|
1297
|
-
console.log(logFormat(level, args));
|
|
1298
|
-
}
|
|
1299
|
-
};
|
|
1300
|
-
var logger$4 = {
|
|
1301
|
-
info: args => log$3('info', args),
|
|
1302
|
-
warn: args => log$3('warn', args),
|
|
1303
|
-
error: args => log$3('error', args),
|
|
1304
|
-
debug: args => log$3('debug', args)
|
|
1305
|
-
};
|
|
1306
|
-
var _loop = function _loop(level) {
|
|
1307
|
-
logger$4[level] = logInfo => {
|
|
1308
|
-
var {
|
|
1309
|
-
ID,
|
|
1310
|
-
mediaType,
|
|
1311
|
-
action,
|
|
1312
|
-
description,
|
|
1313
|
-
error
|
|
1314
|
-
} = logInfo;
|
|
1315
|
-
currentLevel = level;
|
|
1316
|
-
return log$3(level, {
|
|
1317
|
-
ID,
|
|
1318
|
-
mediaType,
|
|
1319
|
-
action,
|
|
1320
|
-
description,
|
|
1321
|
-
error
|
|
1322
|
-
});
|
|
1323
|
-
};
|
|
1324
|
-
};
|
|
1325
|
-
for (var level of ['info', 'warn', 'error', 'debug']) {
|
|
1326
|
-
_loop(level);
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
32
|
var domain;
|
|
1330
33
|
|
|
1331
34
|
// This constructor is used to store event handlers. Instantiating this is
|
|
@@ -1798,6 +501,63 @@ function unwrapListeners$3(arr) {
|
|
|
1798
501
|
return ret;
|
|
1799
502
|
}
|
|
1800
503
|
|
|
504
|
+
var MEDIA = 'MEDIA';
|
|
505
|
+
var DEVICE = 'DEVICE';
|
|
506
|
+
var MEDIA_STREAM_TRACK = 'MEDIA_STREAM_TRACK';
|
|
507
|
+
|
|
508
|
+
var LEVELS = {
|
|
509
|
+
error: 1,
|
|
510
|
+
warn: 2,
|
|
511
|
+
info: 3,
|
|
512
|
+
debug: 4
|
|
513
|
+
};
|
|
514
|
+
var logFormat = (level, logDetails) => {
|
|
515
|
+
var {
|
|
516
|
+
ID,
|
|
517
|
+
mediaType,
|
|
518
|
+
action,
|
|
519
|
+
description,
|
|
520
|
+
error
|
|
521
|
+
} = logDetails;
|
|
522
|
+
var timestamp = new Date().toISOString();
|
|
523
|
+
var errorText = error ? error.stack ? "".concat(error.message, ": ").concat(error.stack) : "".concat(error) : '';
|
|
524
|
+
return "".concat(timestamp, " ").concat(level, " ").concat(ID || '', " ").concat(mediaType, " ").concat(action, " ").concat(description, " ").concat(errorText).replace(/\s+/g, ' ').trim();
|
|
525
|
+
};
|
|
526
|
+
var currentLevel = 'error';
|
|
527
|
+
var log$3 = (level, args) => {
|
|
528
|
+
if (LEVELS[level] <= LEVELS[currentLevel]) {
|
|
529
|
+
console.log(logFormat(level, args));
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
var logger$4 = {
|
|
533
|
+
info: args => log$3('info', args),
|
|
534
|
+
warn: args => log$3('warn', args),
|
|
535
|
+
error: args => log$3('error', args),
|
|
536
|
+
debug: args => log$3('debug', args)
|
|
537
|
+
};
|
|
538
|
+
var _loop = function _loop(level) {
|
|
539
|
+
logger$4[level] = logInfo => {
|
|
540
|
+
var {
|
|
541
|
+
ID,
|
|
542
|
+
mediaType,
|
|
543
|
+
action,
|
|
544
|
+
description,
|
|
545
|
+
error
|
|
546
|
+
} = logInfo;
|
|
547
|
+
currentLevel = level;
|
|
548
|
+
return log$3(level, {
|
|
549
|
+
ID,
|
|
550
|
+
mediaType,
|
|
551
|
+
action,
|
|
552
|
+
description,
|
|
553
|
+
error
|
|
554
|
+
});
|
|
555
|
+
};
|
|
556
|
+
};
|
|
557
|
+
for (var level of ['info', 'warn', 'error', 'debug']) {
|
|
558
|
+
_loop(level);
|
|
559
|
+
}
|
|
560
|
+
|
|
1801
561
|
function _classPrivateFieldInitSpec$1(obj, privateMap, value) { _checkPrivateRedeclaration$1(obj, privateMap); privateMap.set(obj, value); }
|
|
1802
562
|
function _checkPrivateRedeclaration$1(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
1803
563
|
var DeviceKinds;
|
|
@@ -2377,7 +1137,7 @@ function _deviceChangePublisher() {
|
|
|
2377
1137
|
});
|
|
2378
1138
|
return _deviceChangePublisher.apply(this, arguments);
|
|
2379
1139
|
}
|
|
2380
|
-
function on(_x4, _x5) {
|
|
1140
|
+
function on$1(_x4, _x5) {
|
|
2381
1141
|
return _on.apply(this, arguments);
|
|
2382
1142
|
}
|
|
2383
1143
|
function _on() {
|
|
@@ -2396,7 +1156,7 @@ function _on() {
|
|
|
2396
1156
|
});
|
|
2397
1157
|
return _on.apply(this, arguments);
|
|
2398
1158
|
}
|
|
2399
|
-
var off = (eventName, listener) => {
|
|
1159
|
+
var off$1 = (eventName, listener) => {
|
|
2400
1160
|
logger$4.debug({
|
|
2401
1161
|
mediaType: MEDIA,
|
|
2402
1162
|
action: 'off()',
|
|
@@ -2691,6 +1451,232 @@ var Error$1 = /*#__PURE__*/Object.freeze({
|
|
|
2691
1451
|
|
|
2692
1452
|
class EventEmitter$5 extends EventEmitter$6 {}
|
|
2693
1453
|
|
|
1454
|
+
var global$1 = (typeof global !== "undefined" ? global :
|
|
1455
|
+
typeof self !== "undefined" ? self :
|
|
1456
|
+
typeof window !== "undefined" ? window : {});
|
|
1457
|
+
|
|
1458
|
+
// shim for using process in browser
|
|
1459
|
+
// based off https://github.com/defunctzombie/node-process/blob/master/browser.js
|
|
1460
|
+
|
|
1461
|
+
function defaultSetTimout() {
|
|
1462
|
+
throw new Error('setTimeout has not been defined');
|
|
1463
|
+
}
|
|
1464
|
+
function defaultClearTimeout () {
|
|
1465
|
+
throw new Error('clearTimeout has not been defined');
|
|
1466
|
+
}
|
|
1467
|
+
var cachedSetTimeout = defaultSetTimout;
|
|
1468
|
+
var cachedClearTimeout = defaultClearTimeout;
|
|
1469
|
+
if (typeof global$1.setTimeout === 'function') {
|
|
1470
|
+
cachedSetTimeout = setTimeout;
|
|
1471
|
+
}
|
|
1472
|
+
if (typeof global$1.clearTimeout === 'function') {
|
|
1473
|
+
cachedClearTimeout = clearTimeout;
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
function runTimeout(fun) {
|
|
1477
|
+
if (cachedSetTimeout === setTimeout) {
|
|
1478
|
+
//normal enviroments in sane situations
|
|
1479
|
+
return setTimeout(fun, 0);
|
|
1480
|
+
}
|
|
1481
|
+
// if setTimeout wasn't available but was latter defined
|
|
1482
|
+
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
|
1483
|
+
cachedSetTimeout = setTimeout;
|
|
1484
|
+
return setTimeout(fun, 0);
|
|
1485
|
+
}
|
|
1486
|
+
try {
|
|
1487
|
+
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
1488
|
+
return cachedSetTimeout(fun, 0);
|
|
1489
|
+
} catch(e){
|
|
1490
|
+
try {
|
|
1491
|
+
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
1492
|
+
return cachedSetTimeout.call(null, fun, 0);
|
|
1493
|
+
} catch(e){
|
|
1494
|
+
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
|
1495
|
+
return cachedSetTimeout.call(this, fun, 0);
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
|
|
1500
|
+
}
|
|
1501
|
+
function runClearTimeout(marker) {
|
|
1502
|
+
if (cachedClearTimeout === clearTimeout) {
|
|
1503
|
+
//normal enviroments in sane situations
|
|
1504
|
+
return clearTimeout(marker);
|
|
1505
|
+
}
|
|
1506
|
+
// if clearTimeout wasn't available but was latter defined
|
|
1507
|
+
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
|
1508
|
+
cachedClearTimeout = clearTimeout;
|
|
1509
|
+
return clearTimeout(marker);
|
|
1510
|
+
}
|
|
1511
|
+
try {
|
|
1512
|
+
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
1513
|
+
return cachedClearTimeout(marker);
|
|
1514
|
+
} catch (e){
|
|
1515
|
+
try {
|
|
1516
|
+
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
1517
|
+
return cachedClearTimeout.call(null, marker);
|
|
1518
|
+
} catch (e){
|
|
1519
|
+
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
|
1520
|
+
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
|
1521
|
+
return cachedClearTimeout.call(this, marker);
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
|
|
1526
|
+
|
|
1527
|
+
}
|
|
1528
|
+
var queue$2 = [];
|
|
1529
|
+
var draining = false;
|
|
1530
|
+
var currentQueue;
|
|
1531
|
+
var queueIndex = -1;
|
|
1532
|
+
|
|
1533
|
+
function cleanUpNextTick() {
|
|
1534
|
+
if (!draining || !currentQueue) {
|
|
1535
|
+
return;
|
|
1536
|
+
}
|
|
1537
|
+
draining = false;
|
|
1538
|
+
if (currentQueue.length) {
|
|
1539
|
+
queue$2 = currentQueue.concat(queue$2);
|
|
1540
|
+
} else {
|
|
1541
|
+
queueIndex = -1;
|
|
1542
|
+
}
|
|
1543
|
+
if (queue$2.length) {
|
|
1544
|
+
drainQueue();
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
function drainQueue() {
|
|
1549
|
+
if (draining) {
|
|
1550
|
+
return;
|
|
1551
|
+
}
|
|
1552
|
+
var timeout = runTimeout(cleanUpNextTick);
|
|
1553
|
+
draining = true;
|
|
1554
|
+
|
|
1555
|
+
var len = queue$2.length;
|
|
1556
|
+
while(len) {
|
|
1557
|
+
currentQueue = queue$2;
|
|
1558
|
+
queue$2 = [];
|
|
1559
|
+
while (++queueIndex < len) {
|
|
1560
|
+
if (currentQueue) {
|
|
1561
|
+
currentQueue[queueIndex].run();
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
queueIndex = -1;
|
|
1565
|
+
len = queue$2.length;
|
|
1566
|
+
}
|
|
1567
|
+
currentQueue = null;
|
|
1568
|
+
draining = false;
|
|
1569
|
+
runClearTimeout(timeout);
|
|
1570
|
+
}
|
|
1571
|
+
function nextTick(fun) {
|
|
1572
|
+
var args = new Array(arguments.length - 1);
|
|
1573
|
+
if (arguments.length > 1) {
|
|
1574
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1575
|
+
args[i - 1] = arguments[i];
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
queue$2.push(new Item(fun, args));
|
|
1579
|
+
if (queue$2.length === 1 && !draining) {
|
|
1580
|
+
runTimeout(drainQueue);
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
// v8 likes predictible objects
|
|
1584
|
+
function Item(fun, array) {
|
|
1585
|
+
this.fun = fun;
|
|
1586
|
+
this.array = array;
|
|
1587
|
+
}
|
|
1588
|
+
Item.prototype.run = function () {
|
|
1589
|
+
this.fun.apply(null, this.array);
|
|
1590
|
+
};
|
|
1591
|
+
var title = 'browser';
|
|
1592
|
+
var platform = 'browser';
|
|
1593
|
+
var browser = true;
|
|
1594
|
+
var env = {};
|
|
1595
|
+
var argv = [];
|
|
1596
|
+
var version = ''; // empty string to avoid regexp issues
|
|
1597
|
+
var versions = {};
|
|
1598
|
+
var release = {};
|
|
1599
|
+
var config = {};
|
|
1600
|
+
|
|
1601
|
+
function noop() {}
|
|
1602
|
+
|
|
1603
|
+
var on = noop;
|
|
1604
|
+
var addListener = noop;
|
|
1605
|
+
var once$4 = noop;
|
|
1606
|
+
var off = noop;
|
|
1607
|
+
var removeListener = noop;
|
|
1608
|
+
var removeAllListeners = noop;
|
|
1609
|
+
var emit = noop;
|
|
1610
|
+
|
|
1611
|
+
function binding(name) {
|
|
1612
|
+
throw new Error('process.binding is not supported');
|
|
1613
|
+
}
|
|
1614
|
+
|
|
1615
|
+
function cwd () { return '/' }
|
|
1616
|
+
function chdir (dir) {
|
|
1617
|
+
throw new Error('process.chdir is not supported');
|
|
1618
|
+
}function umask() { return 0; }
|
|
1619
|
+
|
|
1620
|
+
// from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
|
|
1621
|
+
var performance$1 = global$1.performance || {};
|
|
1622
|
+
var performanceNow =
|
|
1623
|
+
performance$1.now ||
|
|
1624
|
+
performance$1.mozNow ||
|
|
1625
|
+
performance$1.msNow ||
|
|
1626
|
+
performance$1.oNow ||
|
|
1627
|
+
performance$1.webkitNow ||
|
|
1628
|
+
function(){ return (new Date()).getTime() };
|
|
1629
|
+
|
|
1630
|
+
// generate timestamp or delta
|
|
1631
|
+
// see http://nodejs.org/api/process.html#process_process_hrtime
|
|
1632
|
+
function hrtime(previousTimestamp){
|
|
1633
|
+
var clocktime = performanceNow.call(performance$1)*1e-3;
|
|
1634
|
+
var seconds = Math.floor(clocktime);
|
|
1635
|
+
var nanoseconds = Math.floor((clocktime%1)*1e9);
|
|
1636
|
+
if (previousTimestamp) {
|
|
1637
|
+
seconds = seconds - previousTimestamp[0];
|
|
1638
|
+
nanoseconds = nanoseconds - previousTimestamp[1];
|
|
1639
|
+
if (nanoseconds<0) {
|
|
1640
|
+
seconds--;
|
|
1641
|
+
nanoseconds += 1e9;
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
return [seconds,nanoseconds]
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
var startTime = new Date();
|
|
1648
|
+
function uptime() {
|
|
1649
|
+
var currentTime = new Date();
|
|
1650
|
+
var dif = currentTime - startTime;
|
|
1651
|
+
return dif / 1000;
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
var browser$1 = {
|
|
1655
|
+
nextTick: nextTick,
|
|
1656
|
+
title: title,
|
|
1657
|
+
browser: browser,
|
|
1658
|
+
env: env,
|
|
1659
|
+
argv: argv,
|
|
1660
|
+
version: version,
|
|
1661
|
+
versions: versions,
|
|
1662
|
+
on: on,
|
|
1663
|
+
addListener: addListener,
|
|
1664
|
+
once: once$4,
|
|
1665
|
+
off: off,
|
|
1666
|
+
removeListener: removeListener,
|
|
1667
|
+
removeAllListeners: removeAllListeners,
|
|
1668
|
+
emit: emit,
|
|
1669
|
+
binding: binding,
|
|
1670
|
+
cwd: cwd,
|
|
1671
|
+
chdir: chdir,
|
|
1672
|
+
umask: umask,
|
|
1673
|
+
hrtime: hrtime,
|
|
1674
|
+
platform: platform,
|
|
1675
|
+
release: release,
|
|
1676
|
+
config: config,
|
|
1677
|
+
uptime: uptime
|
|
1678
|
+
};
|
|
1679
|
+
|
|
2694
1680
|
function _mergeNamespaces$1(n,m){m.forEach(function(e){e&&typeof e!=='string'&&!Array.isArray(e)&&Object.keys(e).forEach(function(k){if(k!=='default'&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function get(){return e[k];}});}});});return Object.freeze(n);}/******************************************************************************
|
|
2695
1681
|
Copyright (c) Microsoft Corporation.
|
|
2696
1682
|
|
|
@@ -16242,18 +15228,6 @@ class MultistreamRoapMediaConnection extends EventEmitter$6 {
|
|
|
16242
15228
|
|
|
16243
15229
|
var Errors = Error$1;
|
|
16244
15230
|
|
|
16245
|
-
function isBrowserSupported() {
|
|
16246
|
-
var isSupported = false;
|
|
16247
|
-
logger$4.info({
|
|
16248
|
-
mediaType: MEDIA,
|
|
16249
|
-
action: 'isBrowserSupported()',
|
|
16250
|
-
description: 'Checking is current browser supported by webrtc'
|
|
16251
|
-
});
|
|
16252
|
-
if ((DetectRTC.exports.browser.isChrome || DetectRTC.exports.browser.isFirefox || DetectRTC.exports.browser.isSafari || DetectRTC.exports.browser.isEdge) && DetectRTC.exports.isWebRTCSupported) {
|
|
16253
|
-
isSupported = true;
|
|
16254
|
-
}
|
|
16255
|
-
return isSupported;
|
|
16256
|
-
}
|
|
16257
15231
|
var Media = {
|
|
16258
15232
|
createAudioTrack: createAudioTrack,
|
|
16259
15233
|
createVideoTrack: createVideoTrack,
|
|
@@ -16261,15 +15235,14 @@ var Media = {
|
|
|
16261
15235
|
getCameras: getCameras,
|
|
16262
15236
|
getMicrophones: getMicrophones,
|
|
16263
15237
|
getSpeakers: getSpeakers,
|
|
16264
|
-
on: on,
|
|
16265
|
-
off: off,
|
|
15238
|
+
on: on$1,
|
|
15239
|
+
off: off$1,
|
|
16266
15240
|
Effects: {
|
|
16267
15241
|
BNR: {
|
|
16268
15242
|
enableBNR: enableBNR,
|
|
16269
15243
|
disableBNR: disableBNR
|
|
16270
15244
|
}
|
|
16271
|
-
}
|
|
16272
|
-
isBrowserSupported
|
|
15245
|
+
}
|
|
16273
15246
|
};
|
|
16274
15247
|
|
|
16275
15248
|
exports.ActiveSpeakerInfo = ActiveSpeakerInfo;
|
|
@@ -16304,6 +15277,5 @@ exports.getLogger = getLogger;
|
|
|
16304
15277
|
exports.getMediaFamily = getMediaFamily;
|
|
16305
15278
|
exports.getRecommendedMaxBitrateForFrameSize = getRecommendedMaxBitrateForFrameSize;
|
|
16306
15279
|
exports.getVideoInputDevices = getVideoInputDevices;
|
|
16307
|
-
exports.isBrowserSupported = isBrowserSupported;
|
|
16308
15280
|
exports.setLogger = setLogger;
|
|
16309
15281
|
exports.setOnDeviceChangeHandler = setOnDeviceChangeHandler;
|