livekit-client 1.11.0 → 1.11.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/livekit-client.esm.mjs +139 -89
- 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/Room.d.ts +5 -4
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/events.d.ts +6 -1
- package/dist/src/room/events.d.ts.map +1 -1
- package/dist/src/room/track/LocalAudioTrack.d.ts +1 -1
- package/dist/src/room/track/LocalAudioTrack.d.ts.map +1 -1
- package/dist/src/room/track/LocalTrack.d.ts +2 -2
- package/dist/src/room/track/LocalTrack.d.ts.map +1 -1
- package/dist/src/room/track/LocalVideoTrack.d.ts +1 -1
- package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
- package/dist/src/room/track/RemoteVideoTrack.d.ts +3 -1
- package/dist/src/room/track/RemoteVideoTrack.d.ts.map +1 -1
- package/dist/src/room/utils.d.ts +1 -0
- package/dist/src/room/utils.d.ts.map +1 -1
- package/dist/ts4.2/src/room/Room.d.ts +5 -4
- package/dist/ts4.2/src/room/events.d.ts +6 -1
- package/dist/ts4.2/src/room/track/LocalAudioTrack.d.ts +1 -1
- package/dist/ts4.2/src/room/track/LocalTrack.d.ts +2 -2
- package/dist/ts4.2/src/room/track/LocalVideoTrack.d.ts +1 -1
- package/dist/ts4.2/src/room/track/RemoteVideoTrack.d.ts +3 -1
- package/dist/ts4.2/src/room/utils.d.ts +1 -0
- package/package.json +1 -1
- package/src/room/Room.test.ts +29 -0
- package/src/room/Room.ts +55 -10
- package/src/room/events.ts +6 -0
- package/src/room/track/LocalAudioTrack.ts +4 -3
- package/src/room/track/LocalTrack.ts +13 -10
- package/src/room/track/LocalVideoTrack.ts +8 -4
- package/src/room/track/RemoteVideoTrack.ts +3 -8
- package/src/room/utils.ts +23 -0
package/dist/src/room/Room.d.ts
CHANGED
@@ -57,6 +57,7 @@ declare class Room extends EventEmitter<RoomEventCallbacks> {
|
|
57
57
|
private disconnectLock;
|
58
58
|
private cachedParticipantSids;
|
59
59
|
private connectionReconcileInterval?;
|
60
|
+
private activeDeviceMap;
|
60
61
|
/**
|
61
62
|
* Creates a new Room, the primary construct for a LiveKit session.
|
62
63
|
* @param options
|
@@ -127,12 +128,11 @@ declare class Room extends EventEmitter<RoomEventCallbacks> {
|
|
127
128
|
get canPlaybackAudio(): boolean;
|
128
129
|
/**
|
129
130
|
* Returns the active audio output device used in this room.
|
130
|
-
*
|
131
|
-
* Note: to get the active `audioinput` or `videoinput` use [[LocalTrack.getDeviceId()]]
|
132
|
-
*
|
133
131
|
* @return the previously successfully set audio output device ID or an empty string if the default device is used.
|
132
|
+
* @deprecated use `getActiveDevice('audiooutput')` instead
|
134
133
|
*/
|
135
134
|
getActiveAudioOutputDevice(): string;
|
135
|
+
getActiveDevice(kind: MediaDeviceKind): string | undefined;
|
136
136
|
/**
|
137
137
|
* Switches all active devices used in this room to the given device.
|
138
138
|
*
|
@@ -143,7 +143,7 @@ declare class Room extends EventEmitter<RoomEventCallbacks> {
|
|
143
143
|
* `audiooutput` to set speaker for all incoming audio tracks
|
144
144
|
* @param deviceId
|
145
145
|
*/
|
146
|
-
switchActiveDevice(kind: MediaDeviceKind, deviceId: string, exact?: boolean): Promise<
|
146
|
+
switchActiveDevice(kind: MediaDeviceKind, deviceId: string, exact?: boolean): Promise<boolean>;
|
147
147
|
private setupLocalParticipantEvents;
|
148
148
|
private recreateEngine;
|
149
149
|
private onTrackAdded;
|
@@ -230,5 +230,6 @@ export type RoomEventCallbacks = {
|
|
230
230
|
signalConnected: () => void;
|
231
231
|
recordingStatusChanged: (recording: boolean) => void;
|
232
232
|
dcBufferStatusChanged: (isLow: boolean, kind: DataPacket_Kind) => void;
|
233
|
+
activeDeviceChanged: (kind: MediaDeviceKind, deviceId: string) => void;
|
233
234
|
};
|
234
235
|
//# sourceMappingURL=Room.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Room.d.ts","sourceRoot":"","sources":["../../../src/room/Room.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAEV,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,eAAe,EACf,gBAAgB,EAGhB,qBAAqB,EAIrB,iBAAiB,EAKlB,MAAM,yBAAyB,CAAC;AAUjC,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;
|
1
|
+
{"version":3,"file":"Room.d.ts","sourceRoot":"","sources":["../../../src/room/Room.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAEV,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,eAAe,EACf,gBAAgB,EAGhB,qBAAqB,EAIrB,iBAAiB,EAKlB,MAAM,yBAAyB,CAAC;AAUjC,OAAO,SAAS,MAAM,aAAa,CAAC;AAWpC,OAAO,gBAAgB,MAAM,gCAAgC,CAAC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B,IAAI,CAAC,EAAE,eAAe,EACtB,KAAK,CAAC,EAAE,MAAM,KACX,IAAI,CAAC;IACV,wBAAwB,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;IACzF,iBAAiB,EAAE,CAAC,KAAK,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,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,sBAAsB,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACrD,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"}
|
@@ -243,7 +243,12 @@ export declare enum RoomEvent {
|
|
243
243
|
* Emits whenever the current buffer status of a data channel changes
|
244
244
|
* args: (isLow: boolean, kind: [[DataPacket_Kind]])
|
245
245
|
*/
|
246
|
-
DCBufferStatusChanged = "dcBufferStatusChanged"
|
246
|
+
DCBufferStatusChanged = "dcBufferStatusChanged",
|
247
|
+
/**
|
248
|
+
* Triggered by a call to room.switchActiveDevice
|
249
|
+
* args: (kind: MediaDeviceKind, deviceId: string)
|
250
|
+
*/
|
251
|
+
ActiveDeviceChanged = "activeDeviceChanged"
|
247
252
|
}
|
248
253
|
export declare enum ParticipantEvent {
|
249
254
|
/**
|
@@ -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;;;OAGG;IACH,YAAY,iBAAiB;IAE7B;;;;OAIG;IACH,sBAAsB,2BAA2B;IAEjD;;OAEG;IACH,YAAY,2BAA2B;IAEvC;;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;;;;;;OAMG;IACH,wBAAwB,6BAA6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kCAAkC,uCAAuC;IAEzE;;;OAGG;IACH,8BAA8B,mCAAmC;IAGjE,gBAAgB;IAChB,iBAAiB,sBAAsB;IAEvC;;;OAGG;IACH,6BAA6B,kCAAkC;CAChE;AAED,gBAAgB;AAChB,oBAAY,WAAW;IACrB,iBAAiB,sBAAsB;IACvC,SAAS,cAAc;IACvB,YAAY,iBAAiB;IAC7B,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,aAAa,kBAAkB;IAC/B,eAAe,oBAAoB;IACnC,OAAO,YAAY;IACnB,eAAe,oBAAoB;IACnC,oBAAoB,yBAAyB;IAC7C,kBAAkB,uBAAuB;IACzC,qBAAqB,0BAA0B;CAChD;AAED,oBAAY,UAAU;IACpB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB;;OAEG;IACH,SAAS,cAAc;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,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;CAC1C"}
|
@@ -12,7 +12,7 @@ export default class LocalAudioTrack extends LocalTrack {
|
|
12
12
|
* @param userProvidedTrack Signals to the SDK whether or not the mediaTrack should be managed (i.e. released and reacquired) internally by the SDK
|
13
13
|
*/
|
14
14
|
constructor(mediaTrack: MediaStreamTrack, constraints?: MediaTrackConstraints, userProvidedTrack?: boolean);
|
15
|
-
setDeviceId(deviceId: ConstrainDOMString): Promise<
|
15
|
+
setDeviceId(deviceId: ConstrainDOMString): Promise<boolean>;
|
16
16
|
mute(): Promise<LocalAudioTrack>;
|
17
17
|
unmute(): Promise<LocalAudioTrack>;
|
18
18
|
restartTrack(options?: AudioCaptureOptions): Promise<void>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LocalAudioTrack.d.ts","sourceRoot":"","sources":["../../../../src/room/track/LocalAudioTrack.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGrD,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU;IACrD,gBAAgB;IAChB,UAAU,EAAE,OAAO,CAAS;IAE5B,OAAO,CAAC,SAAS,CAAC,CAAmB;IAErC;;;;;OAKG;gBAED,UAAU,EAAE,gBAAgB,EAC5B,WAAW,CAAC,EAAE,qBAAqB,EACnC,iBAAiB,UAAO;IAMpB,WAAW,CAAC,QAAQ,EAAE,kBAAkB;
|
1
|
+
{"version":3,"file":"LocalAudioTrack.d.ts","sourceRoot":"","sources":["../../../../src/room/track/LocalAudioTrack.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGrD,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU;IACrD,gBAAgB;IAChB,UAAU,EAAE,OAAO,CAAS;IAE5B,OAAO,CAAC,SAAS,CAAC,CAAmB;IAErC;;;;;OAKG;gBAED,UAAU,EAAE,gBAAgB,EAC5B,WAAW,CAAC,EAAE,qBAAqB,EACnC,iBAAiB,UAAO;IAMpB,WAAW,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC;IAW3D,IAAI,IAAI,OAAO,CAAC,eAAe,CAAC;IAgBhC,MAAM,IAAI,OAAO,CAAC,eAAe,CAAC;IAmBlC,YAAY,CAAC,OAAO,CAAC,EAAE,mBAAmB;cAWhC,OAAO,CAAC,WAAW,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,UAAU,CAAC;IAOjF,YAAY;IAYZ,SAAS,CAAC,aAAa,sBAmBrB;IAEI,cAAc,IAAI,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAyBvD,eAAe;CAUtB"}
|
@@ -50,8 +50,8 @@ export default abstract class LocalTrack extends Track {
|
|
50
50
|
* the server.
|
51
51
|
* this API is unsupported on Safari < 12 due to a bug
|
52
52
|
**/
|
53
|
-
pauseUpstream()
|
54
|
-
resumeUpstream()
|
53
|
+
pauseUpstream: () => Promise<void>;
|
54
|
+
resumeUpstream: () => Promise<void>;
|
55
55
|
/**
|
56
56
|
* Sets a processor on this track.
|
57
57
|
* See https://github.com/livekit/track-processors-js for example usage
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LocalTrack.d.ts","sourceRoot":"","sources":["../../../../src/room/track/LocalTrack.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAoC,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,KAAK,EAAgC,MAAM,SAAS,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAIxD,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,UAAW,SAAQ,KAAK;IACpD,gBAAgB;IAChB,MAAM,CAAC,EAAE,YAA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O,CAAC,UAAU,CAAC;IAgDjF,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO;IAYtC,SAAS,KAAK,kBAAkB,IAAI,OAAO,CAO1C;cAEe,0BAA0B;IAY1C,OAAO,CAAC,WAAW,CAOjB;IAEF,IAAI;IAUJ;;;;;QAKI;IACJ,aAAa,sBAsBX;IAEF,cAAc,sBAkBZ;IAEF;;;;;;;;;OASG;IACG,YAAY,CAChB,SAAS,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,EAC3C,0BAA0B,UAAO;IAwCnC,YAAY;IAIZ;;;;;;OAMG;IACG,aAAa;IAanB,SAAS,CAAC,QAAQ,CAAC,aAAa,IAAI,IAAI;CACzC"}
|
@@ -32,7 +32,7 @@ export default class LocalVideoTrack extends LocalTrack {
|
|
32
32
|
unmute(): Promise<LocalVideoTrack>;
|
33
33
|
getSenderStats(): Promise<VideoSenderStats[]>;
|
34
34
|
setPublishingQuality(maxQuality: VideoQuality): void;
|
35
|
-
setDeviceId(deviceId: ConstrainDOMString): Promise<
|
35
|
+
setDeviceId(deviceId: ConstrainDOMString): Promise<boolean>;
|
36
36
|
restartTrack(options?: VideoCaptureOptions): Promise<void>;
|
37
37
|
addSimulcastTrack(codec: VideoCodec, encodings?: RTCRtpEncodingParameters[]): SimulcastTrackInfo;
|
38
38
|
setSimulcastTrackSender(codec: VideoCodec, sender: RTCRtpSender): void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LocalVideoTrack.d.ts","sourceRoot":"","sources":["../../../../src/room/track/LocalVideoTrack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGlF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM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CAAC,OAAO,CAAC;IAgB3D,YAAY,CAAC,OAAO,CAAC,EAAE,mBAAmB;IAWhD,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,wBAAwB,EAAE,GAAG,kBAAkB;IAchG,uBAAuB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY;IAgB/D;;;OAGG;IACG,mBAAmB,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAyC3E;;;OAGG;IACG,mBAAmB,CAAC,SAAS,EAAE,iBAAiB,EAAE;IASxD,SAAS,CAAC,aAAa,sBAyBrB;cAEc,0BAA0B;CAO3C;AAkHD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAW5D;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,wBAAwB,EAAE,EACtC,GAAG,CAAC,EAAE,OAAO,GACZ,UAAU,EAAE,CA6Cd"}
|
@@ -6,9 +6,11 @@ export default class RemoteVideoTrack extends RemoteTrack {
|
|
6
6
|
private adaptiveStreamSettings?;
|
7
7
|
private lastVisible?;
|
8
8
|
private lastDimensions?;
|
9
|
-
private isObserved;
|
10
9
|
constructor(mediaTrack: MediaStreamTrack, sid: string, receiver?: RTCRtpReceiver, adaptiveStreamSettings?: AdaptiveStreamSettings);
|
11
10
|
get isAdaptiveStream(): boolean;
|
11
|
+
/**
|
12
|
+
* Note: When using adaptiveStream, you need to use remoteVideoTrack.attach() to add the track to a HTMLVideoElement, otherwise your video tracks might never start
|
13
|
+
*/
|
12
14
|
get mediaStreamTrack(): MediaStreamTrack;
|
13
15
|
/** @internal */
|
14
16
|
setMuted(muted: boolean): void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RemoteVideoTrack.d.ts","sourceRoot":"","sources":["../../../../src/room/track/RemoteVideoTrack.ts"],"names":[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;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,eAAe,GAAG,gBAAgB,EACzC,OAAO,CAAC,EAAE,oBAAoB;;;;EA+C/B;AAED,qBAAa,KAAK;IAChB,OAAO,CAAC,QAAQ,CAAgB;IAEhC,OAAO,CAAC,MAAM,CAAS;;IAOvB,QAAQ;IAIR,IAAI,kBAGoB,IAAI;CAgB7B;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,kBAAkB,GAAG,MAAM,CAqBvE"}
|
@@ -57,6 +57,7 @@ declare class Room extends EventEmitter<RoomEventCallbacks> {
|
|
57
57
|
private disconnectLock;
|
58
58
|
private cachedParticipantSids;
|
59
59
|
private connectionReconcileInterval?;
|
60
|
+
private activeDeviceMap;
|
60
61
|
/**
|
61
62
|
* Creates a new Room, the primary construct for a LiveKit session.
|
62
63
|
* @param options
|
@@ -127,12 +128,11 @@ declare class Room extends EventEmitter<RoomEventCallbacks> {
|
|
127
128
|
get canPlaybackAudio(): boolean;
|
128
129
|
/**
|
129
130
|
* Returns the active audio output device used in this room.
|
130
|
-
*
|
131
|
-
* Note: to get the active `audioinput` or `videoinput` use [[LocalTrack.getDeviceId()]]
|
132
|
-
*
|
133
131
|
* @return the previously successfully set audio output device ID or an empty string if the default device is used.
|
132
|
+
* @deprecated use `getActiveDevice('audiooutput')` instead
|
134
133
|
*/
|
135
134
|
getActiveAudioOutputDevice(): string;
|
135
|
+
getActiveDevice(kind: MediaDeviceKind): string | undefined;
|
136
136
|
/**
|
137
137
|
* Switches all active devices used in this room to the given device.
|
138
138
|
*
|
@@ -143,7 +143,7 @@ declare class Room extends EventEmitter<RoomEventCallbacks> {
|
|
143
143
|
* `audiooutput` to set speaker for all incoming audio tracks
|
144
144
|
* @param deviceId
|
145
145
|
*/
|
146
|
-
switchActiveDevice(kind: MediaDeviceKind, deviceId: string, exact?: boolean): Promise<
|
146
|
+
switchActiveDevice(kind: MediaDeviceKind, deviceId: string, exact?: boolean): Promise<boolean>;
|
147
147
|
private setupLocalParticipantEvents;
|
148
148
|
private recreateEngine;
|
149
149
|
private onTrackAdded;
|
@@ -230,5 +230,6 @@ export type RoomEventCallbacks = {
|
|
230
230
|
signalConnected: () => void;
|
231
231
|
recordingStatusChanged: (recording: boolean) => void;
|
232
232
|
dcBufferStatusChanged: (isLow: boolean, kind: DataPacket_Kind) => void;
|
233
|
+
activeDeviceChanged: (kind: MediaDeviceKind, deviceId: string) => void;
|
233
234
|
};
|
234
235
|
//# sourceMappingURL=Room.d.ts.map
|
@@ -243,7 +243,12 @@ export declare enum RoomEvent {
|
|
243
243
|
* Emits whenever the current buffer status of a data channel changes
|
244
244
|
* args: (isLow: boolean, kind: [[DataPacket_Kind]])
|
245
245
|
*/
|
246
|
-
DCBufferStatusChanged = "dcBufferStatusChanged"
|
246
|
+
DCBufferStatusChanged = "dcBufferStatusChanged",
|
247
|
+
/**
|
248
|
+
* Triggered by a call to room.switchActiveDevice
|
249
|
+
* args: (kind: MediaDeviceKind, deviceId: string)
|
250
|
+
*/
|
251
|
+
ActiveDeviceChanged = "activeDeviceChanged"
|
247
252
|
}
|
248
253
|
export declare enum ParticipantEvent {
|
249
254
|
/**
|
@@ -12,7 +12,7 @@ export default class LocalAudioTrack extends LocalTrack {
|
|
12
12
|
* @param userProvidedTrack Signals to the SDK whether or not the mediaTrack should be managed (i.e. released and reacquired) internally by the SDK
|
13
13
|
*/
|
14
14
|
constructor(mediaTrack: MediaStreamTrack, constraints?: MediaTrackConstraints, userProvidedTrack?: boolean);
|
15
|
-
setDeviceId(deviceId: ConstrainDOMString): Promise<
|
15
|
+
setDeviceId(deviceId: ConstrainDOMString): Promise<boolean>;
|
16
16
|
mute(): Promise<LocalAudioTrack>;
|
17
17
|
unmute(): Promise<LocalAudioTrack>;
|
18
18
|
restartTrack(options?: AudioCaptureOptions): Promise<void>;
|
@@ -50,8 +50,8 @@ export default abstract class LocalTrack extends Track {
|
|
50
50
|
* the server.
|
51
51
|
* this API is unsupported on Safari < 12 due to a bug
|
52
52
|
**/
|
53
|
-
pauseUpstream()
|
54
|
-
resumeUpstream()
|
53
|
+
pauseUpstream: () => Promise<void>;
|
54
|
+
resumeUpstream: () => Promise<void>;
|
55
55
|
/**
|
56
56
|
* Sets a processor on this track.
|
57
57
|
* See https://github.com/livekit/track-processors-js for example usage
|
@@ -32,7 +32,7 @@ export default class LocalVideoTrack extends LocalTrack {
|
|
32
32
|
unmute(): Promise<LocalVideoTrack>;
|
33
33
|
getSenderStats(): Promise<VideoSenderStats[]>;
|
34
34
|
setPublishingQuality(maxQuality: VideoQuality): void;
|
35
|
-
setDeviceId(deviceId: ConstrainDOMString): Promise<
|
35
|
+
setDeviceId(deviceId: ConstrainDOMString): Promise<boolean>;
|
36
36
|
restartTrack(options?: VideoCaptureOptions): Promise<void>;
|
37
37
|
addSimulcastTrack(codec: VideoCodec, encodings?: RTCRtpEncodingParameters[]): SimulcastTrackInfo;
|
38
38
|
setSimulcastTrackSender(codec: VideoCodec, sender: RTCRtpSender): void;
|
@@ -6,9 +6,11 @@ export default class RemoteVideoTrack extends RemoteTrack {
|
|
6
6
|
private adaptiveStreamSettings?;
|
7
7
|
private lastVisible?;
|
8
8
|
private lastDimensions?;
|
9
|
-
private isObserved;
|
10
9
|
constructor(mediaTrack: MediaStreamTrack, sid: string, receiver?: RTCRtpReceiver, adaptiveStreamSettings?: AdaptiveStreamSettings);
|
11
10
|
get isAdaptiveStream(): boolean;
|
11
|
+
/**
|
12
|
+
* Note: When using adaptiveStream, you need to use remoteVideoTrack.attach() to add the track to a HTMLVideoElement, otherwise your video tracks might never start
|
13
|
+
*/
|
12
14
|
get mediaStreamTrack(): MediaStreamTrack;
|
13
15
|
/** @internal */
|
14
16
|
setMuted(muted: boolean): void;
|
package/package.json
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
import Room from './Room';
|
2
|
+
import { RoomEvent } from './events';
|
3
|
+
|
4
|
+
describe('Active device switch', () => {
|
5
|
+
it('updates devices correctly', async () => {
|
6
|
+
const room = new Room();
|
7
|
+
await room.switchActiveDevice('audioinput', 'test');
|
8
|
+
expect(room.getActiveDevice('audioinput')).toBe('test');
|
9
|
+
});
|
10
|
+
it('updates devices with exact constraint', async () => {
|
11
|
+
const room = new Room();
|
12
|
+
await room.switchActiveDevice('audioinput', 'test', true);
|
13
|
+
expect(room.getActiveDevice('audioinput')).toBe('test');
|
14
|
+
});
|
15
|
+
it('emits changed event', async () => {
|
16
|
+
const room = new Room();
|
17
|
+
let kind: MediaDeviceKind | undefined;
|
18
|
+
let deviceId: string | undefined;
|
19
|
+
const deviceChangeHandler = (_kind: MediaDeviceKind, _deviceId: string) => {
|
20
|
+
kind = _kind;
|
21
|
+
deviceId = _deviceId;
|
22
|
+
};
|
23
|
+
room.on(RoomEvent.ActiveDeviceChanged, deviceChangeHandler);
|
24
|
+
await room.switchActiveDevice('audioinput', 'test', true);
|
25
|
+
|
26
|
+
expect(deviceId).toBe('test');
|
27
|
+
expect(kind).toBe('audioinput');
|
28
|
+
});
|
29
|
+
});
|
package/src/room/Room.ts
CHANGED
@@ -68,6 +68,7 @@ import {
|
|
68
68
|
isWeb,
|
69
69
|
supportsSetSinkId,
|
70
70
|
unpackStreamId,
|
71
|
+
unwrapConstraint,
|
71
72
|
} from './utils';
|
72
73
|
|
73
74
|
export enum ConnectionState {
|
@@ -134,6 +135,8 @@ class Room extends EventEmitter<RoomEventCallbacks> {
|
|
134
135
|
|
135
136
|
private connectionReconcileInterval?: ReturnType<typeof setInterval>;
|
136
137
|
|
138
|
+
private activeDeviceMap: Map<MediaDeviceKind, string>;
|
139
|
+
|
137
140
|
/**
|
138
141
|
* Creates a new Room, the primary construct for a LiveKit session.
|
139
142
|
* @param options
|
@@ -161,6 +164,22 @@ class Room extends EventEmitter<RoomEventCallbacks> {
|
|
161
164
|
this.maybeCreateEngine();
|
162
165
|
|
163
166
|
this.disconnectLock = new Mutex();
|
167
|
+
this.activeDeviceMap = new Map();
|
168
|
+
if (this.options.videoCaptureDefaults.deviceId) {
|
169
|
+
this.activeDeviceMap.set(
|
170
|
+
'videoinput',
|
171
|
+
unwrapConstraint(this.options.videoCaptureDefaults.deviceId),
|
172
|
+
);
|
173
|
+
}
|
174
|
+
if (this.options.audioCaptureDefaults.deviceId) {
|
175
|
+
this.activeDeviceMap.set(
|
176
|
+
'audioinput',
|
177
|
+
unwrapConstraint(this.options.audioCaptureDefaults.deviceId),
|
178
|
+
);
|
179
|
+
}
|
180
|
+
if (this.options.audioOutput?.deviceId) {
|
181
|
+
this.switchActiveDevice('audiooutput', unwrapConstraint(this.options.audioOutput.deviceId));
|
182
|
+
}
|
164
183
|
|
165
184
|
this.localParticipant = new LocalParticipant('', '', this.engine, this.options);
|
166
185
|
}
|
@@ -717,15 +736,17 @@ class Room extends EventEmitter<RoomEventCallbacks> {
|
|
717
736
|
|
718
737
|
/**
|
719
738
|
* Returns the active audio output device used in this room.
|
720
|
-
*
|
721
|
-
* Note: to get the active `audioinput` or `videoinput` use [[LocalTrack.getDeviceId()]]
|
722
|
-
*
|
723
739
|
* @return the previously successfully set audio output device ID or an empty string if the default device is used.
|
740
|
+
* @deprecated use `getActiveDevice('audiooutput')` instead
|
724
741
|
*/
|
725
742
|
getActiveAudioOutputDevice(): string {
|
726
743
|
return this.options.audioOutput?.deviceId ?? '';
|
727
744
|
}
|
728
745
|
|
746
|
+
getActiveDevice(kind: MediaDeviceKind): string | undefined {
|
747
|
+
return this.activeDeviceMap.get(kind);
|
748
|
+
}
|
749
|
+
|
729
750
|
/**
|
730
751
|
* Switches all active devices used in this room to the given device.
|
731
752
|
*
|
@@ -737,15 +758,20 @@ class Room extends EventEmitter<RoomEventCallbacks> {
|
|
737
758
|
* @param deviceId
|
738
759
|
*/
|
739
760
|
async switchActiveDevice(kind: MediaDeviceKind, deviceId: string, exact: boolean = false) {
|
761
|
+
let deviceHasChanged = false;
|
762
|
+
let success = true;
|
740
763
|
const deviceConstraint = exact ? { exact: deviceId } : deviceId;
|
741
764
|
if (kind === 'audioinput') {
|
742
765
|
const prevDeviceId = this.options.audioCaptureDefaults!.deviceId;
|
743
766
|
this.options.audioCaptureDefaults!.deviceId = deviceConstraint;
|
767
|
+
deviceHasChanged = prevDeviceId !== deviceConstraint;
|
744
768
|
const tracks = Array.from(this.localParticipant.audioTracks.values()).filter(
|
745
769
|
(track) => track.source === Track.Source.Microphone,
|
746
770
|
);
|
747
771
|
try {
|
748
|
-
|
772
|
+
success = (
|
773
|
+
await Promise.all(tracks.map((t) => t.audioTrack?.setDeviceId(deviceConstraint)))
|
774
|
+
).every((val) => val === true);
|
749
775
|
} catch (e) {
|
750
776
|
this.options.audioCaptureDefaults!.deviceId = prevDeviceId;
|
751
777
|
throw e;
|
@@ -753,32 +779,50 @@ class Room extends EventEmitter<RoomEventCallbacks> {
|
|
753
779
|
} else if (kind === 'videoinput') {
|
754
780
|
const prevDeviceId = this.options.videoCaptureDefaults!.deviceId;
|
755
781
|
this.options.videoCaptureDefaults!.deviceId = deviceConstraint;
|
782
|
+
deviceHasChanged = prevDeviceId !== deviceConstraint;
|
756
783
|
const tracks = Array.from(this.localParticipant.videoTracks.values()).filter(
|
757
784
|
(track) => track.source === Track.Source.Camera,
|
758
785
|
);
|
759
786
|
try {
|
760
|
-
|
787
|
+
success = (
|
788
|
+
await Promise.all(tracks.map((t) => t.videoTrack?.setDeviceId(deviceConstraint)))
|
789
|
+
).every((val) => val === true);
|
761
790
|
} catch (e) {
|
762
791
|
this.options.videoCaptureDefaults!.deviceId = prevDeviceId;
|
763
792
|
throw e;
|
764
793
|
}
|
765
794
|
} else if (kind === 'audiooutput') {
|
766
|
-
|
767
|
-
|
795
|
+
if (
|
796
|
+
(!supportsSetSinkId() && !this.options.expWebAudioMix) ||
|
797
|
+
(this.audioContext && !('setSinkId' in this.audioContext))
|
798
|
+
) {
|
768
799
|
throw new Error('cannot switch audio output, setSinkId not supported');
|
769
800
|
}
|
770
801
|
this.options.audioOutput ??= {};
|
771
802
|
const prevDeviceId = this.options.audioOutput.deviceId;
|
772
803
|
this.options.audioOutput.deviceId = deviceId;
|
804
|
+
deviceHasChanged = prevDeviceId !== deviceConstraint;
|
805
|
+
|
773
806
|
try {
|
774
|
-
|
775
|
-
|
776
|
-
|
807
|
+
if (this.options.expWebAudioMix) {
|
808
|
+
// @ts-expect-error setSinkId is not yet in the typescript type of AudioContext
|
809
|
+
this.audioContext?.setSinkId(deviceId);
|
810
|
+
} else {
|
811
|
+
await Promise.all(
|
812
|
+
Array.from(this.participants.values()).map((p) => p.setAudioOutput({ deviceId })),
|
813
|
+
);
|
814
|
+
}
|
777
815
|
} catch (e) {
|
778
816
|
this.options.audioOutput.deviceId = prevDeviceId;
|
779
817
|
throw e;
|
780
818
|
}
|
781
819
|
}
|
820
|
+
if (deviceHasChanged && success) {
|
821
|
+
this.activeDeviceMap.set(kind, deviceId);
|
822
|
+
this.emit(RoomEvent.ActiveDeviceChanged, kind, deviceId);
|
823
|
+
}
|
824
|
+
|
825
|
+
return success;
|
782
826
|
}
|
783
827
|
|
784
828
|
private setupLocalParticipantEvents() {
|
@@ -1717,4 +1761,5 @@ export type RoomEventCallbacks = {
|
|
1717
1761
|
signalConnected: () => void;
|
1718
1762
|
recordingStatusChanged: (recording: boolean) => void;
|
1719
1763
|
dcBufferStatusChanged: (isLow: boolean, kind: DataPacket_Kind) => void;
|
1764
|
+
activeDeviceChanged: (kind: MediaDeviceKind, deviceId: string) => void;
|
1720
1765
|
};
|
package/src/room/events.ts
CHANGED
@@ -278,6 +278,12 @@ export enum RoomEvent {
|
|
278
278
|
* args: (isLow: boolean, kind: [[DataPacket_Kind]])
|
279
279
|
*/
|
280
280
|
DCBufferStatusChanged = 'dcBufferStatusChanged',
|
281
|
+
|
282
|
+
/**
|
283
|
+
* Triggered by a call to room.switchActiveDevice
|
284
|
+
* args: (kind: MediaDeviceKind, deviceId: string)
|
285
|
+
*/
|
286
|
+
ActiveDeviceChanged = 'activeDeviceChanged',
|
281
287
|
}
|
282
288
|
|
283
289
|
export enum ParticipantEvent {
|
@@ -2,7 +2,7 @@ import log from '../../logger';
|
|
2
2
|
import { TrackEvent } from '../events';
|
3
3
|
import { computeBitrate, monitorFrequency } from '../stats';
|
4
4
|
import type { AudioSenderStats } from '../stats';
|
5
|
-
import { isWeb } from '../utils';
|
5
|
+
import { isWeb, unwrapConstraint } from '../utils';
|
6
6
|
import LocalTrack from './LocalTrack';
|
7
7
|
import { Track } from './Track';
|
8
8
|
import type { AudioCaptureOptions } from './options';
|
@@ -29,14 +29,15 @@ export default class LocalAudioTrack extends LocalTrack {
|
|
29
29
|
this.checkForSilence();
|
30
30
|
}
|
31
31
|
|
32
|
-
async setDeviceId(deviceId: ConstrainDOMString) {
|
32
|
+
async setDeviceId(deviceId: ConstrainDOMString): Promise<boolean> {
|
33
33
|
if (this.constraints.deviceId === deviceId) {
|
34
|
-
return;
|
34
|
+
return true;
|
35
35
|
}
|
36
36
|
this.constraints.deviceId = deviceId;
|
37
37
|
if (!this.isMuted) {
|
38
38
|
await this.restartTrack();
|
39
39
|
}
|
40
|
+
return unwrapConstraint(deviceId) === this.mediaStreamTrack.getSettings().deviceId;
|
40
41
|
}
|
41
42
|
|
42
43
|
async mute(): Promise<LocalAudioTrack> {
|
@@ -117,10 +117,7 @@ export default abstract class LocalTrack extends Track {
|
|
117
117
|
// the track is "muted"
|
118
118
|
// note this is different from LocalTrack.mute because we do not want to
|
119
119
|
// touch MediaStreamTrack.enabled
|
120
|
-
newTrack.addEventListener('mute',
|
121
|
-
log.info('pausing upstream due to device mute');
|
122
|
-
this.pauseUpstream();
|
123
|
-
});
|
120
|
+
newTrack.addEventListener('mute', this.pauseUpstream);
|
124
121
|
newTrack.addEventListener('unmute', this.resumeUpstream);
|
125
122
|
this.constraints = newTrack.getConstraints();
|
126
123
|
}
|
@@ -185,7 +182,7 @@ export default abstract class LocalTrack extends Track {
|
|
185
182
|
}
|
186
183
|
|
187
184
|
log.debug('replace MediaStreamTrack');
|
188
|
-
this.setMediaStreamTrack(track);
|
185
|
+
await this.setMediaStreamTrack(track);
|
189
186
|
// this must be synced *after* setting mediaStreamTrack above, since it relies
|
190
187
|
// on the previous state in order to cleanup
|
191
188
|
this.providedByUser = userProvidedTrack;
|
@@ -230,7 +227,7 @@ export default abstract class LocalTrack extends Track {
|
|
230
227
|
newTrack.addEventListener('ended', this.handleEnded);
|
231
228
|
log.debug('re-acquired MediaStreamTrack');
|
232
229
|
|
233
|
-
this.setMediaStreamTrack(newTrack);
|
230
|
+
await this.setMediaStreamTrack(newTrack);
|
234
231
|
this.constraints = constraints;
|
235
232
|
if (this.processor) {
|
236
233
|
const processor = this.processor;
|
@@ -281,11 +278,17 @@ export default abstract class LocalTrack extends Track {
|
|
281
278
|
if (this.isInBackground) {
|
282
279
|
this.reacquireTrack = true;
|
283
280
|
}
|
281
|
+
this._mediaStreamTrack.removeEventListener('mute', this.pauseUpstream);
|
282
|
+
this._mediaStreamTrack.removeEventListener('unmute', this.resumeUpstream);
|
284
283
|
this.emit(TrackEvent.Ended, this);
|
285
284
|
};
|
286
285
|
|
287
286
|
stop() {
|
288
287
|
super.stop();
|
288
|
+
|
289
|
+
this._mediaStreamTrack.removeEventListener('ended', this.handleEnded);
|
290
|
+
this._mediaStreamTrack.removeEventListener('mute', this.pauseUpstream);
|
291
|
+
this._mediaStreamTrack.removeEventListener('unmute', this.resumeUpstream);
|
289
292
|
this.processor?.destroy();
|
290
293
|
this.processor = undefined;
|
291
294
|
}
|
@@ -296,7 +299,7 @@ export default abstract class LocalTrack extends Track {
|
|
296
299
|
* the server.
|
297
300
|
* this API is unsupported on Safari < 12 due to a bug
|
298
301
|
**/
|
299
|
-
async
|
302
|
+
pauseUpstream = async () => {
|
300
303
|
const unlock = await this.pauseUpstreamLock.lock();
|
301
304
|
try {
|
302
305
|
if (this._isUpstreamPaused === true) {
|
@@ -318,9 +321,9 @@ export default abstract class LocalTrack extends Track {
|
|
318
321
|
} finally {
|
319
322
|
unlock();
|
320
323
|
}
|
321
|
-
}
|
324
|
+
};
|
322
325
|
|
323
|
-
async
|
326
|
+
resumeUpstream = async () => {
|
324
327
|
const unlock = await this.pauseUpstreamLock.lock();
|
325
328
|
try {
|
326
329
|
if (this._isUpstreamPaused === false) {
|
@@ -338,7 +341,7 @@ export default abstract class LocalTrack extends Track {
|
|
338
341
|
} finally {
|
339
342
|
unlock();
|
340
343
|
}
|
341
|
-
}
|
344
|
+
};
|
342
345
|
|
343
346
|
/**
|
344
347
|
* Sets a processor on this track.
|