livekit-client 1.9.4 → 1.9.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/livekit-client.esm.mjs +864 -1537
- package/dist/livekit-client.esm.mjs.map +1 -1
- package/dist/livekit-client.umd.js +1 -1
- package/dist/livekit-client.umd.js.map +1 -1
- package/dist/src/api/SignalClient.d.ts +1 -2
- package/dist/src/api/SignalClient.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts +1 -0
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/participant/LocalParticipant.d.ts +0 -1
- package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
- package/dist/src/room/utils.d.ts.map +1 -1
- package/dist/src/utils/AsyncQueue.d.ts.map +1 -0
- package/dist/src/utils/browserParser.d.ts +10 -0
- package/dist/src/utils/browserParser.d.ts.map +1 -0
- package/dist/ts4.2/src/api/SignalClient.d.ts +1 -2
- package/dist/ts4.2/src/room/Room.d.ts +1 -0
- package/dist/ts4.2/src/room/participant/LocalParticipant.d.ts +0 -1
- package/dist/ts4.2/src/utils/browserParser.d.ts +10 -0
- package/package.json +6 -4
- package/src/api/SignalClient.ts +1 -2
- package/src/room/Room.ts +5 -2
- package/src/room/participant/LocalParticipant.ts +0 -1
- package/src/room/utils.ts +17 -16
- package/src/{AsyncQueue.test.ts → utils/AsyncQueue.test.ts} +1 -1
- package/src/{AsyncQueue.ts → utils/AsyncQueue.ts} +1 -1
- package/src/utils/browserParser.test.ts +58 -0
- package/src/utils/browserParser.ts +72 -0
- package/dist/src/AsyncQueue.d.ts.map +0 -1
- /package/dist/src/{AsyncQueue.d.ts → utils/AsyncQueue.d.ts} +0 -0
- /package/dist/ts4.2/src/{AsyncQueue.d.ts → utils/AsyncQueue.d.ts} +0 -0
@@ -1,7 +1,6 @@
|
|
1
|
-
import 'webrtc-adapter';
|
2
|
-
import { AsyncQueue } from '../AsyncQueue';
|
3
1
|
import { ParticipantInfo, ReconnectReason, Room, SpeakerInfo, VideoLayer } from '../proto/livekit_models';
|
4
2
|
import { AddTrackRequest, ConnectionQualityUpdate, JoinResponse, LeaveRequest, ReconnectResponse, SessionDescription, SignalRequest, SignalTarget, SimulateScenario, StreamStateUpdate, SubscribedQualityUpdate, SubscriptionPermissionUpdate, SyncState, TrackPermission, TrackPublishedResponse, TrackUnpublishedResponse, UpdateSubscription, UpdateTrackSettings } from '../proto/livekit_rtc';
|
3
|
+
import { AsyncQueue } from '../utils/AsyncQueue';
|
5
4
|
interface ConnectOpts {
|
6
5
|
autoSubscribe: boolean;
|
7
6
|
/** internal */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SignalClient.d.ts","sourceRoot":"","sources":["../../../src/api/SignalClient.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"SignalClient.d.ts","sourceRoot":"","sources":["../../../src/api/SignalClient.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,eAAe,EACf,eAAe,EACf,IAAI,EACJ,WAAW,EACX,UAAU,EACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EAEb,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,4BAA4B,EAC5B,SAAS,EACT,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,UAAU,WAAW;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,eAAe;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,eAAe;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,kBAAkB;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAGD,M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adapter';
|
2
3
|
import type { InternalRoomOptions, RoomConnectOptions, RoomOptions } from '../options';
|
3
4
|
import { DataPacket_Kind, DisconnectReason, ParticipantPermission } from '../proto/livekit_models';
|
4
5
|
import RTCEngine from './RTCEngine';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Room.d.ts","sourceRoot":"","sources":["../../../src/room/Room.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,YAAY,MAAM,eAAe,CAAC;
|
1
|
+
{"version":3,"file":"Room.d.ts","sourceRoot":"","sources":["../../../src/room/Room.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,YAAY,MAAM,eAAe,CAAC;AAC9C,OAAO,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAEV,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,eAAe,EACf,gBAAgB,EAGhB,qBAAqB,EAQtB,MAAM,yBAAyB,CAAC;AASjC,OAAO,SAAS,MAAM,aAAa,CAAC;AAWpC,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,WAAW,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,iBAAiB,MAAM,iCAAiC,CAAC;AAGhE,OAAO,qBAAqB,MAAM,+BAA+B,CAAC;AAElE,OAAO,KAAK,WAAW,MAAM,qBAAqB,CAAC;AACnD,OAAO,sBAAsB,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAGjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAYrE,oBAAY,eAAe;IACzB,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,YAAY,iBAAiB;CAC9B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EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACrD,qBAAqB,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;CACxE,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LocalParticipant.d.ts","sourceRoot":"","sources":["../../../../src/room/participant/LocalParticipant.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"LocalParticipant.d.ts","sourceRoot":"","sources":["../../../../src/room/participant/LocalParticipant.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAc,eAAe,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC1F,OAAO,EAEL,eAAe,EAGf,sBAAsB,EAEvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAI1C,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,qBAAqB,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAOpD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,WAAW;IACvD,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAEhD,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAEhD,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rB,cAAc,CAAC,EAAE,kBAAkB,GAClC,OAAO,CAAC,IAAI,CAAC;IAChB;;;;;;;;;;OAUG;IACG,WAAW,CACf,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,eAAe,EACrB,WAAW,CAAC,EAAE,iBAAiB,EAAE,GAAG,MAAM,EAAE,GAC3C,OAAO,CAAC,IAAI,CAAC;IAwChB;;;;;;;;;;;;;;;;OAgBG;IACH,+BAA+B,CAC7B,sBAAsB,EAAE,OAAO,EAC/B,2BAA2B,GAAE,0BAA0B,EAAO;IAShE,gBAAgB;IAChB,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO;IA8B1C,OAAO,CAAC,kCAAkC,CASxC;IAEF,gBAAgB;IAChB,OAAO,CAAC,cAAc,CAEpB;IAGF,gBAAgB;IAChB,OAAO,CAAC,YAAY,CAWlB;IAEF,OAAO,CAAC,qBAAqB,CAG3B;IAEF,OAAO,CAAC,sBAAsB,CAG5B;IAEF,OAAO,CAAC,6BAA6B,CA0BnC;IAEF,OAAO,CAAC,2BAA2B,CAUjC;IAEF,OAAO,CAAC,gBAAgB,CA+CtB;IAEF,OAAO,CAAC,sBAAsB;IAwB9B,gBAAgB;IAChB,mBAAmB,IAAI,sBAAsB,EAAE;IAa/C,gBAAgB;IAChB,gBAAgB,IAAI,eAAe,EAAE;CAoBtC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/room/utils.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/room/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,yBAAyB,CAAC;AAIrE,OAAO,KAAK,eAAe,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,gBAAgB,MAAM,0BAA0B,CAAC;AAK7D,eAAO,MAAM,cAAc,4FACgE,CAAC;AAE5F,wBAAgB,cAAc,CAAC,MAAM,EAAE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OvB,QAAQ;IAIR,IAAI,kBAGoB,IAAI;CAgB7B"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AsyncQueue.d.ts","sourceRoot":"","sources":["../../../src/utils/AsyncQueue.ts"],"names":[],"mappings":"AAEA,KAAK,SAAS,CAAC,CAAC,IAAI,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC;AAEzC,aAAK,eAAe;IAClB,SAAS,IAAA;IACT,SAAS,IAAA;IACT,WAAW,IAAA;CACZ;AAED,KAAK,aAAa,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,eAAe,CAAC;CACzB,CAAC;AAEF,qBAAa,UAAU;IACrB,OAAO,CAAC,YAAY,CAA6B;IAEjD,OAAO,CAAC,SAAS,CAAQ;IAEzB,OAAO,CAAC,aAAa,CAAS;;IAQxB,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;IAmBzB,KAAK;IAIX,QAAQ;CAGT"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export type DetectableBrowser = 'Chrome' | 'Firefox' | 'Safari';
|
2
|
+
export type BrowserDetails = {
|
3
|
+
name: DetectableBrowser;
|
4
|
+
version: string;
|
5
|
+
};
|
6
|
+
/**
|
7
|
+
* @internal
|
8
|
+
*/
|
9
|
+
export declare function getBrowser(userAgent?: string, force?: boolean): BrowserDetails | undefined;
|
10
|
+
//# sourceMappingURL=browserParser.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"browserParser.d.ts","sourceRoot":"","sources":["../../../src/utils/browserParser.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEhE,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAIF;;GAEG;AACH,wBAAgB,UAAU,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,UAAO,8BAa1D"}
|
@@ -1,7 +1,6 @@
|
|
1
|
-
import 'webrtc-adapter';
|
2
|
-
import { AsyncQueue } from '../AsyncQueue';
|
3
1
|
import { ParticipantInfo, ReconnectReason, Room, SpeakerInfo, VideoLayer } from '../proto/livekit_models';
|
4
2
|
import { AddTrackRequest, ConnectionQualityUpdate, JoinResponse, LeaveRequest, ReconnectResponse, SessionDescription, SignalRequest, SignalTarget, SimulateScenario, StreamStateUpdate, SubscribedQualityUpdate, SubscriptionPermissionUpdate, SyncState, TrackPermission, TrackPublishedResponse, TrackUnpublishedResponse, UpdateSubscription, UpdateTrackSettings } from '../proto/livekit_rtc';
|
3
|
+
import { AsyncQueue } from '../utils/AsyncQueue';
|
5
4
|
interface ConnectOpts {
|
6
5
|
autoSubscribe: boolean;
|
7
6
|
/** internal */
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import type TypedEmitter from 'typed-emitter';
|
2
|
+
import 'webrtc-adapter';
|
2
3
|
import type { InternalRoomOptions, RoomConnectOptions, RoomOptions } from '../options';
|
3
4
|
import { DataPacket_Kind, DisconnectReason, ParticipantPermission } from '../proto/livekit_models';
|
4
5
|
import RTCEngine from './RTCEngine';
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export type DetectableBrowser = 'Chrome' | 'Firefox' | 'Safari';
|
2
|
+
export type BrowserDetails = {
|
3
|
+
name: DetectableBrowser;
|
4
|
+
version: string;
|
5
|
+
};
|
6
|
+
/**
|
7
|
+
* @internal
|
8
|
+
*/
|
9
|
+
export declare function getBrowser(userAgent?: string, force?: boolean): BrowserDetails | undefined;
|
10
|
+
//# sourceMappingURL=browserParser.d.ts.map
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "livekit-client",
|
3
|
-
"version": "1.9.
|
3
|
+
"version": "1.9.5",
|
4
4
|
"description": "JavaScript/TypeScript client SDK for LiveKit",
|
5
5
|
"main": "./dist/livekit-client.umd.js",
|
6
6
|
"unpkg": "./dist/livekit-client.umd.js",
|
@@ -38,7 +38,8 @@
|
|
38
38
|
"format:check": "prettier --check src",
|
39
39
|
"release": "yarn build && yarn compat && changeset publish",
|
40
40
|
"downlevel-dts": "downlevel-dts ./dist/ ./dist/ts4.2 --to=4.2",
|
41
|
-
"compat": "eslint --no-eslintrc --config ./.eslintrc.dist.cjs ./dist/livekit-client.umd.js"
|
41
|
+
"compat": "eslint --no-eslintrc --config ./.eslintrc.dist.cjs ./dist/livekit-client.umd.js",
|
42
|
+
"size-limit": "size-limit"
|
42
43
|
},
|
43
44
|
"dependencies": {
|
44
45
|
"events": "^3.3.0",
|
@@ -47,7 +48,6 @@
|
|
47
48
|
"sdp-transform": "^2.14.1",
|
48
49
|
"ts-debounce": "^4.0.0",
|
49
50
|
"typed-emitter": "^2.1.0",
|
50
|
-
"ua-parser-js": "^1.0.2",
|
51
51
|
"webrtc-adapter": "^8.1.1"
|
52
52
|
},
|
53
53
|
"devDependencies": {
|
@@ -60,6 +60,8 @@
|
|
60
60
|
"@rollup/plugin-json": "6.0.0",
|
61
61
|
"@rollup/plugin-node-resolve": "15.0.2",
|
62
62
|
"@rollup/plugin-terser": "^0.4.0",
|
63
|
+
"@size-limit/file": "^8.2.4",
|
64
|
+
"@size-limit/webpack": "^8.2.4",
|
63
65
|
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
|
64
66
|
"@types/events": "^3.0.0",
|
65
67
|
"@types/jest": "29.5.1",
|
@@ -78,9 +80,9 @@
|
|
78
80
|
"prettier": "^2.8.8",
|
79
81
|
"rollup": "3.21.3",
|
80
82
|
"rollup-plugin-delete": "^2.0.0",
|
81
|
-
"rollup-plugin-filesize": "10.0.0",
|
82
83
|
"rollup-plugin-re": "1.0.7",
|
83
84
|
"rollup-plugin-typescript2": "0.34.1",
|
85
|
+
"size-limit": "^8.2.4",
|
84
86
|
"ts-jest": "29.1.0",
|
85
87
|
"ts-proto": "1.147.1",
|
86
88
|
"typedoc": "0.24.6",
|
package/src/api/SignalClient.ts
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
import 'webrtc-adapter';
|
2
|
-
import { AsyncQueue } from '../AsyncQueue';
|
3
1
|
import log from '../logger';
|
4
2
|
import {
|
5
3
|
ClientInfo,
|
@@ -34,6 +32,7 @@ import {
|
|
34
32
|
import { ConnectionError, ConnectionErrorReason } from '../room/errors';
|
35
33
|
import CriticalTimers from '../room/timers';
|
36
34
|
import { Mutex, getClientInfo, isReactNative, sleep } from '../room/utils';
|
35
|
+
import { AsyncQueue } from '../utils/AsyncQueue';
|
37
36
|
|
38
37
|
// internal options
|
39
38
|
interface ConnectOpts {
|
package/src/room/Room.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { EventEmitter } from 'events';
|
2
2
|
import type TypedEmitter from 'typed-emitter';
|
3
|
+
import 'webrtc-adapter';
|
3
4
|
import { toProtoSessionDescription } from '../api/SignalClient';
|
4
5
|
import log from '../logger';
|
5
6
|
import type {
|
@@ -1369,11 +1370,13 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
|
|
1369
1370
|
) {
|
1370
1371
|
consecutiveFailures++;
|
1371
1372
|
log.warn('detected connection state mismatch', { numFailures: consecutiveFailures });
|
1372
|
-
if (consecutiveFailures >= 3)
|
1373
|
+
if (consecutiveFailures >= 3) {
|
1374
|
+
this.recreateEngine();
|
1373
1375
|
this.handleDisconnect(
|
1374
1376
|
this.options.stopLocalTrackOnUnpublish,
|
1375
|
-
DisconnectReason.
|
1377
|
+
DisconnectReason.STATE_MISMATCH,
|
1376
1378
|
);
|
1379
|
+
}
|
1377
1380
|
} else {
|
1378
1381
|
consecutiveFailures = 0;
|
1379
1382
|
}
|
package/src/room/utils.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
import UAParser from 'ua-parser-js';
|
2
1
|
import { ClientInfo, ClientInfo_SDK } from '../proto/livekit_models';
|
2
|
+
import { getBrowser } from '../utils/browserParser';
|
3
|
+
import type { DetectableBrowser } from '../utils/browserParser';
|
3
4
|
import { protocolVersion, version } from '../version';
|
4
5
|
import type LocalAudioTrack from './track/LocalAudioTrack';
|
5
6
|
import type RemoteAudioTrack from './track/RemoteAudioTrack';
|
@@ -90,13 +91,10 @@ export function supportsSetSinkId(elm?: HTMLMediaElement): boolean {
|
|
90
91
|
return 'setSinkId' in elm;
|
91
92
|
}
|
92
93
|
|
93
|
-
const setCodecPreferencesVersions:
|
94
|
+
const setCodecPreferencesVersions: Record<DetectableBrowser, string> = {
|
94
95
|
Chrome: '100',
|
95
|
-
Chromium: '100',
|
96
96
|
Safari: '15',
|
97
97
|
Firefox: '100',
|
98
|
-
Edge: '100',
|
99
|
-
Brave: '1.40',
|
100
98
|
};
|
101
99
|
|
102
100
|
export function supportsSetCodecPreferences(transceiver: RTCRtpTransceiver): boolean {
|
@@ -106,14 +104,14 @@ export function supportsSetCodecPreferences(transceiver: RTCRtpTransceiver): boo
|
|
106
104
|
if (!('setCodecPreferences' in transceiver)) {
|
107
105
|
return false;
|
108
106
|
}
|
109
|
-
const
|
110
|
-
if (!
|
107
|
+
const browser = getBrowser();
|
108
|
+
if (!browser?.name || !browser.version) {
|
111
109
|
// version is required
|
112
110
|
return false;
|
113
111
|
}
|
114
|
-
const v = setCodecPreferencesVersions[
|
112
|
+
const v = setCodecPreferencesVersions[browser.name];
|
115
113
|
if (v) {
|
116
|
-
return compareVersions(
|
114
|
+
return compareVersions(browser.version, v) >= 0;
|
117
115
|
}
|
118
116
|
return false;
|
119
117
|
}
|
@@ -123,18 +121,15 @@ export function isBrowserSupported() {
|
|
123
121
|
}
|
124
122
|
|
125
123
|
export function isFireFox(): boolean {
|
126
|
-
|
127
|
-
return navigator.userAgent.indexOf('Firefox') !== -1;
|
124
|
+
return getBrowser()?.name === 'Firefox';
|
128
125
|
}
|
129
126
|
|
130
127
|
export function isChromiumBased(): boolean {
|
131
|
-
|
132
|
-
return navigator.userAgent.indexOf('Chrom') !== -1;
|
128
|
+
return getBrowser()?.name === 'Chrome';
|
133
129
|
}
|
134
130
|
|
135
131
|
export function isSafari(): boolean {
|
136
|
-
|
137
|
-
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
132
|
+
return getBrowser()?.name === 'Safari';
|
138
133
|
}
|
139
134
|
|
140
135
|
export function isMobile(): boolean {
|
@@ -197,12 +192,18 @@ export function getDevicePixelRatio(): number {
|
|
197
192
|
export function compareVersions(v1: string, v2: string): number {
|
198
193
|
const parts1 = v1.split('.');
|
199
194
|
const parts2 = v2.split('.');
|
200
|
-
const k = Math.min(
|
195
|
+
const k = Math.min(parts1.length, parts2.length);
|
201
196
|
for (let i = 0; i < k; ++i) {
|
202
197
|
const p1 = parseInt(parts1[i], 10);
|
203
198
|
const p2 = parseInt(parts2[i], 10);
|
204
199
|
if (p1 > p2) return 1;
|
205
200
|
if (p1 < p2) return -1;
|
201
|
+
if (i === k - 1 && p1 === p2) return 0;
|
202
|
+
}
|
203
|
+
if (v1 === '' && v2 !== '') {
|
204
|
+
return -1;
|
205
|
+
} else if (v2 === '') {
|
206
|
+
return 1;
|
206
207
|
}
|
207
208
|
return parts1.length == parts2.length ? 0 : parts1.length < parts2.length ? -1 : 1;
|
208
209
|
}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import { compareVersions } from '../room/utils';
|
2
|
+
import { getBrowser } from './browserParser';
|
3
|
+
|
4
|
+
describe('browser parser', () => {
|
5
|
+
const safariUA =
|
6
|
+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15';
|
7
|
+
const firefoxUA =
|
8
|
+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/112.0';
|
9
|
+
|
10
|
+
const chromeUA =
|
11
|
+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36';
|
12
|
+
|
13
|
+
const braveUA =
|
14
|
+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36';
|
15
|
+
|
16
|
+
it('parses Safari correctly', () => {
|
17
|
+
const details = getBrowser(safariUA, true);
|
18
|
+
expect(details?.name).toBe('Safari');
|
19
|
+
expect(details?.version).toBe('16.3');
|
20
|
+
});
|
21
|
+
it('parses Firefox correctly', () => {
|
22
|
+
const details = getBrowser(firefoxUA, true);
|
23
|
+
expect(details?.name).toBe('Firefox');
|
24
|
+
expect(details?.version).toBe('112.0');
|
25
|
+
});
|
26
|
+
it('parses Chrome correctly', () => {
|
27
|
+
const details = getBrowser(chromeUA, true);
|
28
|
+
expect(details?.name).toBe('Chrome');
|
29
|
+
expect(details?.version).toBe('112.0.0.0');
|
30
|
+
});
|
31
|
+
it('detects brave as chromium based', () => {
|
32
|
+
const details = getBrowser(braveUA, true);
|
33
|
+
expect(details?.name).toBe('Chrome');
|
34
|
+
expect(details?.version).toBe('103.0.5060.134');
|
35
|
+
});
|
36
|
+
});
|
37
|
+
|
38
|
+
describe('version compare', () => {
|
39
|
+
it('compares versions correctly', () => {
|
40
|
+
expect(compareVersions('12.3.5', '11.8.9')).toBe(1);
|
41
|
+
expect(compareVersions('12.3.5', '12.3.5')).toBe(0);
|
42
|
+
expect(compareVersions('12.3.5', '14.1.5')).toBe(-1);
|
43
|
+
});
|
44
|
+
it('can handle different version lengths', () => {
|
45
|
+
expect(compareVersions('12', '11.8.9')).toBe(1);
|
46
|
+
expect(compareVersions('12', '12.0.0')).toBe(0);
|
47
|
+
expect(compareVersions('12', '14.1.5')).toBe(-1);
|
48
|
+
|
49
|
+
expect(compareVersions('12.3.5', '11')).toBe(1);
|
50
|
+
expect(compareVersions('12.0.0', '12')).toBe(0);
|
51
|
+
expect(compareVersions('12.3.5', '14')).toBe(-1);
|
52
|
+
});
|
53
|
+
|
54
|
+
it('treats empty strings as smaller', () => {
|
55
|
+
expect(compareVersions('12', '')).toBe(1);
|
56
|
+
expect(compareVersions('', '12.0.0')).toBe(-1);
|
57
|
+
});
|
58
|
+
});
|
@@ -0,0 +1,72 @@
|
|
1
|
+
// tiny, simplified version of https://github.com/lancedikson/bowser/blob/master/src/parser-browsers.js
|
2
|
+
// reduced to only differentiate Chrome(ium) based browsers / Firefox / Safari
|
3
|
+
|
4
|
+
const commonVersionIdentifier = /version\/(\d+(\.?_?\d+)+)/i;
|
5
|
+
|
6
|
+
export type DetectableBrowser = 'Chrome' | 'Firefox' | 'Safari';
|
7
|
+
|
8
|
+
export type BrowserDetails = {
|
9
|
+
name: DetectableBrowser;
|
10
|
+
version: string;
|
11
|
+
};
|
12
|
+
|
13
|
+
let browserDetails: BrowserDetails | undefined;
|
14
|
+
|
15
|
+
/**
|
16
|
+
* @internal
|
17
|
+
*/
|
18
|
+
export function getBrowser(userAgent?: string, force = true) {
|
19
|
+
if (
|
20
|
+
userAgent === undefined &&
|
21
|
+
(typeof document !== 'undefined' || typeof navigator === 'undefined')
|
22
|
+
) {
|
23
|
+
return;
|
24
|
+
}
|
25
|
+
const ua = (userAgent ?? navigator.userAgent).toLowerCase();
|
26
|
+
if (browserDetails === undefined || force) {
|
27
|
+
const browser = browsersList.find(({ test }) => test.test(ua));
|
28
|
+
browserDetails = browser?.describe(ua);
|
29
|
+
}
|
30
|
+
return browserDetails;
|
31
|
+
}
|
32
|
+
|
33
|
+
const browsersList = [
|
34
|
+
{
|
35
|
+
test: /firefox|iceweasel|fxios/i,
|
36
|
+
describe(ua: string) {
|
37
|
+
const browser: BrowserDetails = {
|
38
|
+
name: 'Firefox',
|
39
|
+
version: getMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i, ua),
|
40
|
+
};
|
41
|
+
return browser;
|
42
|
+
},
|
43
|
+
},
|
44
|
+
{
|
45
|
+
test: /chrom|crios|crmo/i,
|
46
|
+
describe(ua: string) {
|
47
|
+
const browser: BrowserDetails = {
|
48
|
+
name: 'Chrome',
|
49
|
+
version: getMatch(/(?:chrome|chromium|crios|crmo)\/(\d+(\.?_?\d+)+)/i, ua),
|
50
|
+
};
|
51
|
+
|
52
|
+
return browser;
|
53
|
+
},
|
54
|
+
},
|
55
|
+
/* Safari */
|
56
|
+
{
|
57
|
+
test: /safari|applewebkit/i,
|
58
|
+
describe(ua: string) {
|
59
|
+
const browser: BrowserDetails = {
|
60
|
+
name: 'Safari',
|
61
|
+
version: getMatch(commonVersionIdentifier, ua),
|
62
|
+
};
|
63
|
+
|
64
|
+
return browser;
|
65
|
+
},
|
66
|
+
},
|
67
|
+
];
|
68
|
+
|
69
|
+
function getMatch(exp: RegExp, ua: string, id = 1) {
|
70
|
+
const match = ua.match(exp);
|
71
|
+
return (match && match.length >= id && match[id]) || '';
|
72
|
+
}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"AsyncQueue.d.ts","sourceRoot":"","sources":["../../src/AsyncQueue.ts"],"names":[],"mappings":"AAEA,KAAK,SAAS,CAAC,CAAC,IAAI,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC;AAEzC,aAAK,eAAe;IAClB,SAAS,IAAA;IACT,SAAS,IAAA;IACT,WAAW,IAAA;CACZ;AAED,KAAK,aAAa,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,eAAe,CAAC;CACzB,CAAC;AAEF,qBAAa,UAAU;IACrB,OAAO,CAAC,YAAY,CAA6B;IAEjD,OAAO,CAAC,SAAS,CAAQ;IAEzB,OAAO,CAAC,aAAa,CAAS;;IAQxB,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;IAmBzB,KAAK;IAIX,QAAQ;CAGT"}
|
File without changes
|
File without changes
|