livekit-client 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -6
- package/dist/livekit-client.esm.mjs +27 -14
- 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/room/DeviceManager.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts +3 -1
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/events.d.ts +6 -0
- package/dist/src/room/events.d.ts.map +1 -1
- package/dist/ts4.2/src/room/Room.d.ts +3 -1
- package/dist/ts4.2/src/room/events.d.ts +6 -0
- package/package.json +9 -9
- package/src/room/DeviceManager.test.ts +105 -0
- package/src/room/DeviceManager.ts +11 -6
- package/src/room/Room.ts +9 -1
- package/src/room/defaults.ts +1 -1
- package/src/room/events.ts +7 -0
- package/src/room/track/LocalTrack.ts +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DeviceManager.d.ts","sourceRoot":"","sources":["../../../src/room/DeviceManager.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAgB;IAExC,MAAM,CAAC,gBAAgB,EAAE,eAAe,EAAE,CAA+C;IAEzF,MAAM,CAAC,WAAW,IAAI,aAAa;IAOnC,MAAM,CAAC,mBAAmB,EAAE,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAa;IAE7E,UAAU,CACd,IAAI,CAAC,EAAE,eAAe,EACtB,kBAAkB,GAAE,OAAc,GACjC,OAAO,CAAC,eAAe,EAAE,CAAC;IA+CvB,iBAAiB,CACrB,IAAI,EAAE,eAAe,EACrB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;
|
1
|
+
{"version":3,"file":"DeviceManager.d.ts","sourceRoot":"","sources":["../../../src/room/DeviceManager.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAgB;IAExC,MAAM,CAAC,gBAAgB,EAAE,eAAe,EAAE,CAA+C;IAEzF,MAAM,CAAC,WAAW,IAAI,aAAa;IAOnC,MAAM,CAAC,mBAAmB,EAAE,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAa;IAE7E,UAAU,CACd,IAAI,CAAC,EAAE,eAAe,EACtB,kBAAkB,GAAE,OAAc,GACjC,OAAO,CAAC,eAAe,EAAE,CAAC;IA+CvB,iBAAiB,CACrB,IAAI,EAAE,eAAe,EACrB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IA4B9B,OAAO,CAAC,cAAc;CAKvB"}
|
package/dist/src/room/Room.d.ts
CHANGED
@@ -17,7 +17,8 @@ export declare enum ConnectionState {
|
|
17
17
|
Disconnected = "disconnected",
|
18
18
|
Connecting = "connecting",
|
19
19
|
Connected = "connected",
|
20
|
-
Reconnecting = "reconnecting"
|
20
|
+
Reconnecting = "reconnecting",
|
21
|
+
SignalReconnecting = "signalReconnecting"
|
21
22
|
}
|
22
23
|
declare const Room_base: new () => TypedEmitter<RoomEventCallbacks>;
|
23
24
|
/**
|
@@ -223,6 +224,7 @@ export default Room;
|
|
223
224
|
export type RoomEventCallbacks = {
|
224
225
|
connected: () => void;
|
225
226
|
reconnecting: () => void;
|
227
|
+
signalReconnecting: () => void;
|
226
228
|
reconnected: () => void;
|
227
229
|
disconnected: (reason?: DisconnectReason) => void;
|
228
230
|
connectionStateChanged: (state: ConnectionState) => void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Room.d.ts","sourceRoot":"","sources":["../../../src/room/Room.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,eAAe,E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K,EAAE,KAAK,KAAK,IAAI,CAAC;IAC1C,uBAAuB,EAAE,CACvB,WAAW,EAAE,sBAAsB,EACnC,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,WAAW,EAAE,iBAAiB,KAC3B,IAAI,CAAC;IACV,kCAAkC,EAAE,CAClC,WAAW,EAAE,sBAAsB,EACnC,MAAM,EAAE,gBAAgB,CAAC,gBAAgB,EACzC,WAAW,EAAE,iBAAiB,KAC3B,IAAI,CAAC;IACV,8BAA8B,EAAE,CAC9B,WAAW,EAAE,sBAAsB,EACnC,MAAM,EAAE,gBAAgB,CAAC,kBAAkB,EAC3C,WAAW,EAAE,iBAAiB,KAC3B,IAAI,CAAC;IACV,oBAAoB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,oBAAoB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,sBAAsB,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACrD,kCAAkC,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC;IAC5F,eAAe,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACxC,qBAAqB,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IACvE,mBAAmB,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACxE,CAAC"}
|
@@ -17,6 +17,12 @@ export declare enum RoomEvent {
|
|
17
17
|
* to reconnect.
|
18
18
|
*/
|
19
19
|
Reconnecting = "reconnecting",
|
20
|
+
/**
|
21
|
+
* When the signal connection to the server has been interrupted. This isn't noticeable to users most of the time.
|
22
|
+
* It will resolve with a `RoomEvent.Reconnected` once the signal connection has been re-established.
|
23
|
+
* If media fails additionally it an additional `RoomEvent.Reconnecting` will be emitted.
|
24
|
+
*/
|
25
|
+
SignalReconnecting = "signalReconnecting",
|
20
26
|
/**
|
21
27
|
* Fires when a reconnection has been successful.
|
22
28
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/room/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,oBAAY,SAAS;IACnB;;OAEG;IACH,SAAS,cAAc;IAEvB;;;OAGG;IACH,YAAY,iBAAiB;IAE7B;;OAEG;IACH,WAAW,gBAAgB;IAE3B;;;;;;;;;;OAUG;IACH,YAAY,iBAAiB;IAE7B;;;;OAIG;IACH,sBAAsB,2BAA2B;IAEjD;;OAEG;IACH,mBAAmB,wBAAwB;IAE3C;;;;;;OAMG;IACH,oBAAoB,yBAAyB;IAE7C;;;;;OAKG;IACH,uBAAuB,4BAA4B;IAEnD;;;;;;;;OAQG;IACH,cAAc,mBAAmB;IAEjC;;;;;OAKG;IACH,eAAe,oBAAoB;IAEnC;;;;OAIG;IACH,uBAAuB,4BAA4B;IAEnD;;;;OAIG;IACH,gBAAgB,qBAAqB;IAErC;;;;;OAKG;IACH,iBAAiB,sBAAsB;IAEvC;;;;OAIG;IACH,UAAU,eAAe;IAEzB;;;;OAIG;IACH,YAAY,iBAAiB;IAE7B;;;;;OAKG;IACH,mBAAmB,wBAAwB;IAE3C;;;;;;;;OAQG;IACH,qBAAqB,0BAA0B;IAE/C;;;;;OAKG;IACH,yBAAyB,8BAA8B;IAEvD;;;;;;;OAOG;IACH,qBAAqB,0BAA0B;IAE/C;;;;;;;;OAQG;IACH,0BAA0B,+BAA+B;IAEzD;;;;;OAKG;IACH,sBAAsB,2BAA2B;IAEjD;;;;;;;OAOG;IACH,mBAAmB,wBAAwB;IAE3C;;;;;;OAMG;IACH,YAAY,iBAAiB;IAE7B;;;;OAIG;IACH,eAAe,oBAAoB;IAEnC;;;OAGG;IACH,qBAAqB,0BAA0B;IAE/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c;IACvB,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,gBAAgB;IAChB,cAAc,mBAAmB;IACjC,gBAAgB;IAChB,kBAAkB,uBAAuB;IACzC,gBAAgB;IAChB,oBAAoB,yBAAyB;IAC7C,gBAAgB;IAChB,mBAAmB,wBAAwB;IAC3C;;;OAGG;IACH,oBAAoB,yBAAyB;IAC7C,gBAAgB;IAChB,iBAAiB,sBAAsB;IACvC,gBAAgB;IAChB,sBAAsB,2BAA2B;IACjD,gBAAgB;IAChB,oBAAoB,yBAAyB;IAC7C,gBAAgB;IAChB,mBAAmB,wBAAwB;IAC3C,gBAAgB;IAChB,eAAe,oBAAoB;IACnC,gBAAgB;IAChB,eAAe,oBAAoB;IACnC;;;OAGG;IACH,cAAc,mBAAmB;IACjC;;;OAGG;IACH,eAAe,oBAAoB;IACnC;;;OAGG;IACH,6BAA6B,kCAAkC;IAC/D;;OAEG;IACH,yBAAyB,8BAA8B;IACvD;;OAEG;IACH,kBAAkB,uBAAuB;IACzC;;OAEG;IACH,oBAAoB,yBAAyB;IAE7C;;OAEG;IACH,uBAAuB,4BAA4B;IAEnD;;OAEG;IACH,qBAAqB,0BAA0B;IAE/C;;OAEG;IACH,cAAc,mBAAmB;CAClC"}
|
@@ -17,7 +17,8 @@ export declare enum ConnectionState {
|
|
17
17
|
Disconnected = "disconnected",
|
18
18
|
Connecting = "connecting",
|
19
19
|
Connected = "connected",
|
20
|
-
Reconnecting = "reconnecting"
|
20
|
+
Reconnecting = "reconnecting",
|
21
|
+
SignalReconnecting = "signalReconnecting"
|
21
22
|
}
|
22
23
|
declare const Room_base: new () => TypedEmitter<RoomEventCallbacks>;
|
23
24
|
/**
|
@@ -223,6 +224,7 @@ export default Room;
|
|
223
224
|
export type RoomEventCallbacks = {
|
224
225
|
connected: () => void;
|
225
226
|
reconnecting: () => void;
|
227
|
+
signalReconnecting: () => void;
|
226
228
|
reconnected: () => void;
|
227
229
|
disconnected: (reason?: DisconnectReason) => void;
|
228
230
|
connectionStateChanged: (state: ConnectionState) => void;
|
@@ -17,6 +17,12 @@ export declare enum RoomEvent {
|
|
17
17
|
* to reconnect.
|
18
18
|
*/
|
19
19
|
Reconnecting = "reconnecting",
|
20
|
+
/**
|
21
|
+
* When the signal connection to the server has been interrupted. This isn't noticeable to users most of the time.
|
22
|
+
* It will resolve with a `RoomEvent.Reconnected` once the signal connection has been re-established.
|
23
|
+
* If media fails additionally it an additional `RoomEvent.Reconnecting` will be emitted.
|
24
|
+
*/
|
25
|
+
SignalReconnecting = "signalReconnecting",
|
20
26
|
/**
|
21
27
|
* Fires when a reconnection has been successful.
|
22
28
|
*/
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "livekit-client",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.3.0",
|
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",
|
@@ -46,13 +46,13 @@
|
|
46
46
|
"webrtc-adapter": "^8.1.1"
|
47
47
|
},
|
48
48
|
"devDependencies": {
|
49
|
-
"@babel/core": "7.24.
|
50
|
-
"@babel/preset-env": "7.24.
|
49
|
+
"@babel/core": "7.24.6",
|
50
|
+
"@babel/preset-env": "7.24.6",
|
51
51
|
"@bufbuild/protoc-gen-es": "^1.3.0",
|
52
|
-
"@changesets/cli": "2.27.
|
52
|
+
"@changesets/cli": "2.27.5",
|
53
53
|
"@livekit/changesets-changelog-github": "^0.0.4",
|
54
54
|
"@rollup/plugin-babel": "6.0.4",
|
55
|
-
"@rollup/plugin-commonjs": "25.0.
|
55
|
+
"@rollup/plugin-commonjs": "25.0.8",
|
56
56
|
"@rollup/plugin-json": "6.1.0",
|
57
57
|
"@rollup/plugin-node-resolve": "15.2.3",
|
58
58
|
"@rollup/plugin-terser": "^0.4.0",
|
@@ -62,8 +62,8 @@
|
|
62
62
|
"@types/events": "^3.0.0",
|
63
63
|
"@types/sdp-transform": "2.4.9",
|
64
64
|
"@types/ua-parser-js": "0.7.39",
|
65
|
-
"@typescript-eslint/eslint-plugin": "
|
66
|
-
"@typescript-eslint/parser": "
|
65
|
+
"@typescript-eslint/eslint-plugin": "7.12.0",
|
66
|
+
"@typescript-eslint/parser": "7.12.0",
|
67
67
|
"downlevel-dts": "^0.11.0",
|
68
68
|
"eslint": "8.57.0",
|
69
69
|
"eslint-config-airbnb-typescript": "18.0.0",
|
@@ -73,7 +73,7 @@
|
|
73
73
|
"gh-pages": "6.1.1",
|
74
74
|
"jsdom": "^24.0.0",
|
75
75
|
"prettier": "^3.0.0",
|
76
|
-
"rollup": "4.
|
76
|
+
"rollup": "4.18.0",
|
77
77
|
"rollup-plugin-delete": "^2.0.0",
|
78
78
|
"rollup-plugin-re": "1.0.7",
|
79
79
|
"rollup-plugin-typescript2": "0.36.0",
|
@@ -81,7 +81,7 @@
|
|
81
81
|
"typedoc": "0.25.13",
|
82
82
|
"typedoc-plugin-no-inherit": "1.4.0",
|
83
83
|
"typescript": "5.4.5",
|
84
|
-
"vite": "5.2.
|
84
|
+
"vite": "5.2.12",
|
85
85
|
"vitest": "^1.0.0"
|
86
86
|
},
|
87
87
|
"scripts": {
|
@@ -0,0 +1,105 @@
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
2
|
+
import DeviceManager from './DeviceManager';
|
3
|
+
|
4
|
+
class MockDeviceManager extends DeviceManager {
|
5
|
+
dummyDevices?: MediaDeviceInfo[];
|
6
|
+
|
7
|
+
async getDevices(
|
8
|
+
kind?: MediaDeviceKind | undefined,
|
9
|
+
requestPermissions?: boolean,
|
10
|
+
): Promise<MediaDeviceInfo[]> {
|
11
|
+
if (this.dummyDevices) {
|
12
|
+
return this.dummyDevices;
|
13
|
+
} else {
|
14
|
+
return super.getDevices(kind, requestPermissions);
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
describe('Active device switch', () => {
|
20
|
+
const deviceManager = new MockDeviceManager();
|
21
|
+
it('normalizes default ID correctly', async () => {
|
22
|
+
deviceManager.dummyDevices = [
|
23
|
+
{
|
24
|
+
deviceId: 'default',
|
25
|
+
kind: 'audiooutput',
|
26
|
+
label: 'Default - Speakers (Intel® Smart Sound Technology for I2S Audio)',
|
27
|
+
groupId: 'c94fea7109a30d468722f3b7778302c716d683a619f41b264b0cf8b2ec202d9g',
|
28
|
+
toJSON: () => 'dummy',
|
29
|
+
},
|
30
|
+
{
|
31
|
+
deviceId: 'communications',
|
32
|
+
kind: 'audiooutput',
|
33
|
+
label: 'Communications - Speakers (2- USB Advanced Audio Device) (0d8c:016c)',
|
34
|
+
groupId: '5146b7ad442c53c9366b141edceca8be30c0a4b31c181968cc732a100176e765',
|
35
|
+
toJSON: () => 'dummy',
|
36
|
+
},
|
37
|
+
{
|
38
|
+
deviceId: 'bfbbf4fbdba0ce0b12159f2f615ba856bdf17743d8b791265db22952d98c28cf',
|
39
|
+
kind: 'audiooutput',
|
40
|
+
label: 'Speakers (2- USB Advanced Audio Device) (0d8c:016c)',
|
41
|
+
groupId: '5146b7ad442c53c9366b141edceca8be30c0a4b31c181968cc732a100176e765',
|
42
|
+
toJSON: () => 'dummy',
|
43
|
+
},
|
44
|
+
{
|
45
|
+
deviceId: '6ca3eb8140dc3d2919d6747f73d8277e6ecaf0f179426695154e98615bafd2b9',
|
46
|
+
kind: 'audiooutput',
|
47
|
+
label: 'Speakers (Intel® Smart Sound Technology for I2S Audio)',
|
48
|
+
groupId: 'c94fea7109a30d468722f3b7778302c716d683a619f41b264b0cf8b2ec202d9g',
|
49
|
+
toJSON: () => 'dummy',
|
50
|
+
},
|
51
|
+
];
|
52
|
+
|
53
|
+
const normalizedID = await deviceManager.normalizeDeviceId('audiooutput', 'default');
|
54
|
+
expect(normalizedID).toBe('6ca3eb8140dc3d2919d6747f73d8277e6ecaf0f179426695154e98615bafd2b9');
|
55
|
+
});
|
56
|
+
it('returns undefined when default cannot be determined', async () => {
|
57
|
+
deviceManager.dummyDevices = [
|
58
|
+
{
|
59
|
+
deviceId: 'default',
|
60
|
+
kind: 'audiooutput',
|
61
|
+
label: 'Default',
|
62
|
+
groupId: 'default',
|
63
|
+
toJSON: () => 'dummy',
|
64
|
+
},
|
65
|
+
{
|
66
|
+
deviceId: 'd5a1ad8b1314736ad1936aae1d74fa524f954c3281b4af3b65b2492330c3a830',
|
67
|
+
kind: 'audiooutput',
|
68
|
+
label: 'Alder Lake PCH-P High Definition Audio Controller HDMI / DisplayPort 3 Output',
|
69
|
+
groupId: 'af6745746c55f7697eadbb5e31a8f28ef836b4d8aefdc3655189a9e7d81eb8d',
|
70
|
+
toJSON: () => 'dummy',
|
71
|
+
},
|
72
|
+
{
|
73
|
+
deviceId: '093f4e51743557382b19da4c0250869b9c6d176423b241f0d52ed665f636e9d2',
|
74
|
+
kind: 'audiooutput',
|
75
|
+
label: 'Alder Lake PCH-P High Definition Audio Controller HDMI / DisplayPort 2 Output',
|
76
|
+
groupId: 'e53791b0ce4bad2b3a515cb1e154acf4758bb563b11942949130190d5c2e0d4',
|
77
|
+
toJSON: () => 'dummy',
|
78
|
+
},
|
79
|
+
{
|
80
|
+
deviceId: 'a6ffa042ac4a88e9ff552ce50b016d0bbf60a9e3c2173a444b064ef1aa022fb5',
|
81
|
+
kind: 'audiooutput',
|
82
|
+
label: 'Alder Lake PCH-P High Definition Audio Controller HDMI / DisplayPort 1 Output',
|
83
|
+
groupId: '69bb8042d093e8b33e9c33710cdfb8c0bba08889904b012e1a186704d74b39a',
|
84
|
+
toJSON: () => 'dummy',
|
85
|
+
},
|
86
|
+
{
|
87
|
+
deviceId: 'd746e22bcfa3f8f76dfce7ee887612982c226eb1f2ed77502ed621b9d7cdae00',
|
88
|
+
kind: 'audiooutput',
|
89
|
+
label: 'Alder Lake PCH-P High Definition Audio Controller Speaker + Headphones',
|
90
|
+
groupId: 'd08b9d0b8d1460c8c120333bdcbc42fbb92fa8e902926fb8b1f35d43ad7f10f',
|
91
|
+
toJSON: () => 'dummy',
|
92
|
+
},
|
93
|
+
{
|
94
|
+
deviceId: 'c43858eb7092870122d5bc3af7b7b7e2f9baf9b3aa829adb34cc84c9f65538a3',
|
95
|
+
kind: 'audiooutput',
|
96
|
+
label: 'T11',
|
97
|
+
groupId: '1ecff3666059160ac3ae559e97286de0ee2487bce8808e9040cba26805d3e15',
|
98
|
+
toJSON: () => 'dummy',
|
99
|
+
},
|
100
|
+
];
|
101
|
+
|
102
|
+
const normalizedID = await deviceManager.normalizeDeviceId('audiooutput', 'default');
|
103
|
+
expect(normalizedID).toBe(undefined);
|
104
|
+
});
|
105
|
+
});
|
@@ -80,17 +80,22 @@ export default class DeviceManager {
|
|
80
80
|
// device has been chosen
|
81
81
|
const devices = await this.getDevices(kind);
|
82
82
|
|
83
|
-
|
84
|
-
const groupIdCounts = new Map(devices.map((d) => [d.groupId, 0]));
|
83
|
+
const defaultDevice = devices.find((d) => d.deviceId === defaultId);
|
85
84
|
|
86
|
-
|
85
|
+
if (!defaultDevice) {
|
86
|
+
log.warn('could not reliably determine default device');
|
87
|
+
return undefined;
|
88
|
+
}
|
87
89
|
|
88
90
|
const device = devices.find(
|
89
|
-
(d) =>
|
90
|
-
(groupId === d.groupId || (groupIdCounts.get(d.groupId) ?? 0) > 1) &&
|
91
|
-
d.deviceId !== defaultId,
|
91
|
+
(d) => d.deviceId !== defaultId && d.groupId === (groupId ?? defaultDevice.groupId),
|
92
92
|
);
|
93
93
|
|
94
|
+
if (!device) {
|
95
|
+
log.warn('could not reliably determine default device');
|
96
|
+
return undefined;
|
97
|
+
}
|
98
|
+
|
94
99
|
return device?.deviceId;
|
95
100
|
}
|
96
101
|
|
package/src/room/Room.ts
CHANGED
@@ -88,9 +88,10 @@ export enum ConnectionState {
|
|
88
88
|
Connecting = 'connecting',
|
89
89
|
Connected = 'connected',
|
90
90
|
Reconnecting = 'reconnecting',
|
91
|
+
SignalReconnecting = 'signalReconnecting',
|
91
92
|
}
|
92
93
|
|
93
|
-
const connectionReconcileFrequency =
|
94
|
+
const connectionReconcileFrequency = 4 * 1000;
|
94
95
|
|
95
96
|
/**
|
96
97
|
* In LiveKit, a room is the logical grouping for a list of participants.
|
@@ -340,6 +341,9 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
|
|
340
341
|
this.clearConnectionReconcile();
|
341
342
|
this.isResuming = true;
|
342
343
|
this.log.info('Resuming signal connection', this.logContext);
|
344
|
+
if (this.setAndEmitConnectionState(ConnectionState.SignalReconnecting)) {
|
345
|
+
this.emit(RoomEvent.SignalReconnecting);
|
346
|
+
}
|
343
347
|
})
|
344
348
|
.on(EngineEvent.Resumed, () => {
|
345
349
|
this.registerConnectionReconcile();
|
@@ -347,6 +351,9 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
|
|
347
351
|
this.log.info('Resumed signal connection', this.logContext);
|
348
352
|
this.updateSubscriptions();
|
349
353
|
this.emitBufferedEvents();
|
354
|
+
if (this.setAndEmitConnectionState(ConnectionState.Connected)) {
|
355
|
+
this.emit(RoomEvent.Reconnected);
|
356
|
+
}
|
350
357
|
})
|
351
358
|
.on(EngineEvent.SignalResumed, () => {
|
352
359
|
this.bufferedEvents = [];
|
@@ -2079,6 +2086,7 @@ export default Room;
|
|
2079
2086
|
export type RoomEventCallbacks = {
|
2080
2087
|
connected: () => void;
|
2081
2088
|
reconnecting: () => void;
|
2089
|
+
signalReconnecting: () => void;
|
2082
2090
|
reconnected: () => void;
|
2083
2091
|
disconnected: (reason?: DisconnectReason) => void;
|
2084
2092
|
connectionStateChanged: (state: ConnectionState) => void;
|
package/src/room/defaults.ts
CHANGED
@@ -37,7 +37,7 @@ export const roomOptionDefaults: InternalRoomOptions = {
|
|
37
37
|
stopLocalTrackOnUnpublish: true,
|
38
38
|
reconnectPolicy: new DefaultReconnectPolicy(),
|
39
39
|
disconnectOnPageLeave: true,
|
40
|
-
webAudioMix:
|
40
|
+
webAudioMix: false,
|
41
41
|
} as const;
|
42
42
|
|
43
43
|
export const roomConnectOptionDefaults: InternalRoomConnectOptions = {
|
package/src/room/events.ts
CHANGED
@@ -20,6 +20,13 @@ export enum RoomEvent {
|
|
20
20
|
*/
|
21
21
|
Reconnecting = 'reconnecting',
|
22
22
|
|
23
|
+
/**
|
24
|
+
* When the signal connection to the server has been interrupted. This isn't noticeable to users most of the time.
|
25
|
+
* It will resolve with a `RoomEvent.Reconnected` once the signal connection has been re-established.
|
26
|
+
* If media fails additionally it an additional `RoomEvent.Reconnecting` will be emitted.
|
27
|
+
*/
|
28
|
+
SignalReconnecting = 'signalReconnecting',
|
29
|
+
|
23
30
|
/**
|
24
31
|
* Fires when a reconnection has been successful.
|
25
32
|
*/
|
@@ -433,7 +433,7 @@ export default abstract class LocalTrack<
|
|
433
433
|
this.emit(TrackEvent.UpstreamResumed, this);
|
434
434
|
|
435
435
|
// this operation is noop if mediastreamtrack is already being sent
|
436
|
-
await this.sender.replaceTrack(this.
|
436
|
+
await this.sender.replaceTrack(this.mediaStreamTrack);
|
437
437
|
} finally {
|
438
438
|
unlock();
|
439
439
|
}
|