livekit-client 1.6.4 → 1.6.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/livekit-client.esm.mjs +264 -33
- 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 +13 -2
- package/dist/src/api/SignalClient.d.ts.map +1 -1
- package/dist/src/proto/livekit_models.d.ts +10 -0
- package/dist/src/proto/livekit_models.d.ts.map +1 -1
- package/dist/src/proto/livekit_rtc.d.ts +2395 -384
- package/dist/src/proto/livekit_rtc.d.ts.map +1 -1
- package/dist/src/room/RTCEngine.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
- package/dist/src/room/track/LocalAudioTrack.d.ts.map +1 -1
- package/dist/ts4.2/src/api/SignalClient.d.ts +13 -2
- package/dist/ts4.2/src/proto/livekit_models.d.ts +10 -0
- package/dist/ts4.2/src/proto/livekit_rtc.d.ts +2567 -440
- package/package.json +1 -1
- package/src/api/SignalClient.ts +41 -2
- package/src/proto/livekit_models.ts +51 -0
- package/src/proto/livekit_rtc.ts +210 -3
- package/src/room/RTCEngine.ts +35 -14
- package/src/room/Room.ts +8 -4
- package/src/room/participant/LocalParticipant.ts +7 -3
- package/src/room/track/LocalAudioTrack.ts +5 -1
package/src/room/Room.ts
CHANGED
@@ -355,12 +355,16 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
|
|
355
355
|
} catch (err) {
|
356
356
|
this.recreateEngine();
|
357
357
|
this.handleDisconnect(this.options.stopLocalTrackOnUnpublish);
|
358
|
-
|
358
|
+
const resultingError = new ConnectionError(`could not establish signal connection`);
|
359
359
|
if (err instanceof Error) {
|
360
|
-
|
361
|
-
log.debug(`error trying to establish signal connection`, { error: err });
|
360
|
+
resultingError.message = `${resultingError.message}: ${err.message}`;
|
362
361
|
}
|
363
|
-
|
362
|
+
if (err instanceof ConnectionError) {
|
363
|
+
resultingError.reason = err.reason;
|
364
|
+
resultingError.status = err.status;
|
365
|
+
}
|
366
|
+
log.debug(`error trying to establish signal connection`, { error: err });
|
367
|
+
reject(resultingError);
|
364
368
|
return;
|
365
369
|
}
|
366
370
|
|
@@ -999,7 +999,9 @@ export default class LocalParticipant extends Participant {
|
|
999
999
|
// detect granted change after permissions were denied to try and resume then
|
1000
1000
|
currentPermissions.onchange = () => {
|
1001
1001
|
if (currentPermissions.state !== 'denied') {
|
1002
|
-
track.
|
1002
|
+
if (!track.isMuted) {
|
1003
|
+
track.restartTrack();
|
1004
|
+
}
|
1003
1005
|
currentPermissions.onchange = null;
|
1004
1006
|
}
|
1005
1007
|
};
|
@@ -1009,8 +1011,10 @@ export default class LocalParticipant extends Participant {
|
|
1009
1011
|
// permissions query fails for firefox, we continue and try to restart the track
|
1010
1012
|
}
|
1011
1013
|
}
|
1012
|
-
|
1013
|
-
|
1014
|
+
if (!track.isMuted) {
|
1015
|
+
log.debug('track ended, attempting to use a different device');
|
1016
|
+
await track.restartTrack();
|
1017
|
+
}
|
1014
1018
|
} catch (e) {
|
1015
1019
|
log.warn(`could not restart track, muting instead`);
|
1016
1020
|
await track.mute();
|
@@ -53,7 +53,11 @@ export default class LocalAudioTrack extends LocalTrack {
|
|
53
53
|
|
54
54
|
async unmute(): Promise<LocalAudioTrack> {
|
55
55
|
await this.muteQueue.run(async () => {
|
56
|
-
if (
|
56
|
+
if (
|
57
|
+
this.source === Track.Source.Microphone &&
|
58
|
+
(this.stopOnMute || this._mediaStreamTrack.readyState === 'ended') &&
|
59
|
+
!this.isUserProvided
|
60
|
+
) {
|
57
61
|
log.debug('reacquiring mic track');
|
58
62
|
await this.restartTrack();
|
59
63
|
}
|