livekit-client 1.12.3 → 1.13.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/livekit-client.e2ee.worker.js +1 -1
- package/dist/livekit-client.e2ee.worker.js.map +1 -1
- package/dist/livekit-client.e2ee.worker.mjs +83 -9
- package/dist/livekit-client.e2ee.worker.mjs.map +1 -1
- package/dist/livekit-client.esm.mjs +357 -97
- 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 +2 -5
- package/dist/src/api/SignalClient.d.ts.map +1 -1
- package/dist/src/connectionHelper/checks/turn.d.ts.map +1 -1
- package/dist/src/connectionHelper/checks/webrtc.d.ts.map +1 -1
- package/dist/src/connectionHelper/checks/websocket.d.ts.map +1 -1
- package/dist/src/e2ee/E2eeManager.d.ts +5 -0
- package/dist/src/e2ee/E2eeManager.d.ts.map +1 -1
- package/dist/src/e2ee/KeyProvider.d.ts +4 -2
- package/dist/src/e2ee/KeyProvider.d.ts.map +1 -1
- package/dist/src/e2ee/constants.d.ts +2 -0
- package/dist/src/e2ee/constants.d.ts.map +1 -1
- package/dist/src/e2ee/types.d.ts +7 -1
- package/dist/src/e2ee/types.d.ts.map +1 -1
- package/dist/src/e2ee/utils.d.ts +1 -0
- package/dist/src/e2ee/utils.d.ts.map +1 -1
- package/dist/src/e2ee/worker/FrameCryptor.d.ts +4 -2
- package/dist/src/e2ee/worker/FrameCryptor.d.ts.map +1 -1
- package/dist/src/e2ee/worker/ParticipantKeyHandler.d.ts.map +1 -1
- package/dist/src/e2ee/worker/SifGuard.d.ts +11 -0
- package/dist/src/e2ee/worker/SifGuard.d.ts.map +1 -0
- package/dist/src/options.d.ts +5 -0
- package/dist/src/options.d.ts.map +1 -1
- package/dist/src/proto/livekit_models_pb.d.ts.map +1 -1
- package/dist/src/proto/livekit_rtc_pb.d.ts.map +1 -1
- package/dist/src/room/DeviceManager.d.ts +1 -0
- package/dist/src/room/DeviceManager.d.ts.map +1 -1
- package/dist/src/room/RTCEngine.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts +1 -1
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/defaults.d.ts.map +1 -1
- package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
- package/dist/src/room/participant/Participant.d.ts +5 -0
- package/dist/src/room/participant/Participant.d.ts.map +1 -1
- package/dist/src/room/participant/RemoteParticipant.d.ts +0 -5
- package/dist/src/room/participant/RemoteParticipant.d.ts.map +1 -1
- package/dist/src/room/timers.d.ts +2 -2
- package/dist/src/room/timers.d.ts.map +1 -1
- package/dist/src/room/track/LocalAudioTrack.d.ts +9 -1
- package/dist/src/room/track/LocalAudioTrack.d.ts.map +1 -1
- package/dist/src/room/track/LocalTrack.d.ts +3 -3
- package/dist/src/room/track/LocalTrack.d.ts.map +1 -1
- package/dist/src/room/track/LocalVideoTrack.d.ts +6 -0
- package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
- package/dist/src/room/track/RemoteAudioTrack.d.ts.map +1 -1
- package/dist/src/room/track/processor/types.d.ts +13 -2
- package/dist/src/room/track/processor/types.d.ts.map +1 -1
- package/dist/src/room/types.d.ts +1 -1
- package/dist/src/room/types.d.ts.map +1 -1
- package/dist/ts4.2/src/api/SignalClient.d.ts +2 -5
- package/dist/ts4.2/src/e2ee/E2eeManager.d.ts +5 -0
- package/dist/ts4.2/src/e2ee/KeyProvider.d.ts +4 -2
- package/dist/ts4.2/src/e2ee/constants.d.ts +2 -0
- package/dist/ts4.2/src/e2ee/types.d.ts +7 -1
- package/dist/ts4.2/src/e2ee/utils.d.ts +1 -0
- package/dist/ts4.2/src/e2ee/worker/FrameCryptor.d.ts +4 -2
- package/dist/ts4.2/src/e2ee/worker/SifGuard.d.ts +11 -0
- package/dist/ts4.2/src/options.d.ts +5 -0
- package/dist/ts4.2/src/room/DeviceManager.d.ts +1 -0
- package/dist/ts4.2/src/room/Room.d.ts +1 -1
- package/dist/ts4.2/src/room/participant/Participant.d.ts +5 -0
- package/dist/ts4.2/src/room/participant/RemoteParticipant.d.ts +0 -5
- package/dist/ts4.2/src/room/timers.d.ts +2 -2
- package/dist/ts4.2/src/room/track/LocalAudioTrack.d.ts +9 -1
- package/dist/ts4.2/src/room/track/LocalTrack.d.ts +3 -3
- package/dist/ts4.2/src/room/track/LocalVideoTrack.d.ts +6 -0
- package/dist/ts4.2/src/room/track/processor/types.d.ts +13 -2
- package/dist/ts4.2/src/room/types.d.ts +1 -1
- package/package.json +15 -16
- package/src/api/SignalClient.ts +13 -9
- package/src/connectionHelper/checks/turn.ts +1 -0
- package/src/connectionHelper/checks/webrtc.ts +9 -7
- package/src/connectionHelper/checks/websocket.ts +1 -0
- package/src/e2ee/E2eeManager.ts +27 -2
- package/src/e2ee/KeyProvider.ts +9 -4
- package/src/e2ee/constants.ts +3 -0
- package/src/e2ee/types.ts +9 -1
- package/src/e2ee/utils.ts +9 -0
- package/src/e2ee/worker/FrameCryptor.ts +46 -17
- package/src/e2ee/worker/ParticipantKeyHandler.ts +1 -0
- package/src/e2ee/worker/SifGuard.ts +47 -0
- package/src/e2ee/worker/e2ee.worker.ts +14 -0
- package/src/options.ts +6 -0
- package/src/proto/livekit_models_pb.ts +14 -0
- package/src/proto/livekit_rtc_pb.ts +14 -0
- package/src/room/DeviceManager.ts +7 -2
- package/src/room/RTCEngine.ts +3 -1
- package/src/room/Room.ts +27 -7
- package/src/room/defaults.ts +1 -0
- package/src/room/participant/LocalParticipant.ts +14 -2
- package/src/room/participant/Participant.ts +16 -0
- package/src/room/participant/RemoteParticipant.ts +0 -12
- package/src/room/track/LocalAudioTrack.ts +45 -0
- package/src/room/track/LocalTrack.ts +4 -4
- package/src/room/track/LocalVideoTrack.ts +39 -0
- package/src/room/track/RemoteAudioTrack.ts +9 -1
- package/src/room/track/RemoteTrackPublication.ts +2 -2
- package/src/room/track/processor/types.ts +17 -2
- package/src/room/types.ts +5 -1
@@ -3465,10 +3465,19 @@ Timestamp.fields = proto3.util.newFieldList(() => [{
|
|
3465
3465
|
T: 5 /* ScalarType.INT32 */
|
3466
3466
|
}]);
|
3467
3467
|
|
3468
|
-
//
|
3469
|
-
//
|
3470
|
-
|
3471
|
-
//
|
3468
|
+
// Copyright 2023 LiveKit, Inc.
|
3469
|
+
//
|
3470
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
3471
|
+
// you may not use this file except in compliance with the License.
|
3472
|
+
// You may obtain a copy of the License at
|
3473
|
+
//
|
3474
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
3475
|
+
//
|
3476
|
+
// Unless required by applicable law or agreed to in writing, software
|
3477
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
3478
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
3479
|
+
// See the License for the specific language governing permissions and
|
3480
|
+
// limitations under the License.
|
3472
3481
|
/**
|
3473
3482
|
* @generated from enum livekit.AudioCodec
|
3474
3483
|
*/
|
@@ -6447,7 +6456,7 @@ function detectBrowser(window) {
|
|
6447
6456
|
};
|
6448
6457
|
|
6449
6458
|
// Fail early if it's not a browser
|
6450
|
-
if (typeof window === 'undefined' || !window.navigator) {
|
6459
|
+
if (typeof window === 'undefined' || !window.navigator || !window.navigator.userAgent) {
|
6451
6460
|
result.browser = 'Not a browser.';
|
6452
6461
|
return result;
|
6453
6462
|
}
|
@@ -9424,10 +9433,19 @@ adapterFactory({
|
|
9424
9433
|
window: typeof window === 'undefined' ? undefined : window
|
9425
9434
|
});
|
9426
9435
|
|
9427
|
-
//
|
9428
|
-
//
|
9429
|
-
|
9430
|
-
//
|
9436
|
+
// Copyright 2023 LiveKit, Inc.
|
9437
|
+
//
|
9438
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
9439
|
+
// you may not use this file except in compliance with the License.
|
9440
|
+
// You may obtain a copy of the License at
|
9441
|
+
//
|
9442
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
9443
|
+
//
|
9444
|
+
// Unless required by applicable law or agreed to in writing, software
|
9445
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
9446
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
9447
|
+
// See the License for the specific language governing permissions and
|
9448
|
+
// limitations under the License.
|
9431
9449
|
/**
|
9432
9450
|
* @generated from enum livekit.SignalTarget
|
9433
9451
|
*/
|
@@ -11823,7 +11841,7 @@ function getMatch(exp, ua) {
|
|
11823
11841
|
return match && match.length >= id && match[id] || '';
|
11824
11842
|
}
|
11825
11843
|
|
11826
|
-
var version$1 = "1.
|
11844
|
+
var version$1 = "1.13.0";
|
11827
11845
|
|
11828
11846
|
const version = version$1;
|
11829
11847
|
const protocolVersion = 9;
|
@@ -13380,8 +13398,13 @@ class SignalClient {
|
|
13380
13398
|
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
13381
13399
|
const abortHandler = () => __awaiter(this, void 0, void 0, function* () {
|
13382
13400
|
this.close();
|
13401
|
+
clearTimeout(wsTimeout);
|
13383
13402
|
reject(new ConnectionError('room connection has been cancelled (signal)'));
|
13384
13403
|
});
|
13404
|
+
const wsTimeout = setTimeout(() => {
|
13405
|
+
this.close();
|
13406
|
+
reject(new ConnectionError('room connection has timed out (signal)'));
|
13407
|
+
}, opts.websocketTimeout);
|
13385
13408
|
if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) {
|
13386
13409
|
abortHandler();
|
13387
13410
|
}
|
@@ -13392,8 +13415,12 @@ class SignalClient {
|
|
13392
13415
|
}
|
13393
13416
|
this.ws = new WebSocket(url + params);
|
13394
13417
|
this.ws.binaryType = 'arraybuffer';
|
13418
|
+
this.ws.onopen = () => {
|
13419
|
+
clearTimeout(wsTimeout);
|
13420
|
+
};
|
13395
13421
|
this.ws.onerror = ev => __awaiter(this, void 0, void 0, function* () {
|
13396
13422
|
if (!this.isConnected) {
|
13423
|
+
clearTimeout(wsTimeout);
|
13397
13424
|
try {
|
13398
13425
|
const resp = yield fetch("http".concat(url.substring(2), "/validate").concat(params));
|
13399
13426
|
if (resp.status.toFixed(0).startsWith('4')) {
|
@@ -13923,6 +13950,12 @@ function createKeyMaterialFromString(password) {
|
|
13923
13950
|
return keyMaterial;
|
13924
13951
|
});
|
13925
13952
|
}
|
13953
|
+
function createKeyMaterialFromBuffer(cryptoBuffer) {
|
13954
|
+
return __awaiter(this, void 0, void 0, function* () {
|
13955
|
+
const keyMaterial = yield crypto.subtle.importKey('raw', cryptoBuffer, 'HKDF', false, ['deriveBits', 'deriveKey']);
|
13956
|
+
return keyMaterial;
|
13957
|
+
});
|
13958
|
+
}
|
13926
13959
|
function getAlgoOptions(algorithmName, salt) {
|
13927
13960
|
const textEncoder = new TextEncoder();
|
13928
13961
|
const encodedSalt = textEncoder.encode(salt);
|
@@ -14047,12 +14080,14 @@ class ExternalE2EEKeyProvider extends BaseKeyProvider {
|
|
14047
14080
|
super(opts);
|
14048
14081
|
}
|
14049
14082
|
/**
|
14050
|
-
* Accepts a passphrase that's used to create the crypto keys
|
14083
|
+
* Accepts a passphrase that's used to create the crypto keys.
|
14084
|
+
* When passing in a string, PBKDF2 is used.
|
14085
|
+
* Also accepts an Array buffer of cryptographically random numbers that uses HKDF.
|
14051
14086
|
* @param key
|
14052
14087
|
*/
|
14053
14088
|
setKey(key) {
|
14054
14089
|
return __awaiter(this, void 0, void 0, function* () {
|
14055
|
-
const derivedKey = yield createKeyMaterialFromString(key);
|
14090
|
+
const derivedKey = typeof key === 'string' ? yield createKeyMaterialFromString(key) : yield createKeyMaterialFromBuffer(key);
|
14056
14091
|
this.onSetEncryptionKey(derivedKey);
|
14057
14092
|
});
|
14058
14093
|
}
|
@@ -14135,9 +14170,9 @@ class DeviceManager {
|
|
14135
14170
|
}
|
14136
14171
|
}
|
14137
14172
|
let devices = yield navigator.mediaDevices.enumerateDevices();
|
14138
|
-
if (requestPermissions &&
|
14173
|
+
if (requestPermissions &&
|
14139
14174
|
// for safari we need to skip this check, as otherwise it will re-acquire user media and fail on iOS https://bugs.webkit.org/show_bug.cgi?id=179363
|
14140
|
-
!
|
14175
|
+
!(isSafari() && this.hasDeviceInUse(kind))) {
|
14141
14176
|
const isDummyDeviceOrEmpty = devices.length === 0 || devices.some(device => {
|
14142
14177
|
const noLabel = device.label === '';
|
14143
14178
|
const isRelevant = kind ? device.kind === kind : true;
|
@@ -14173,6 +14208,9 @@ class DeviceManager {
|
|
14173
14208
|
return device === null || device === void 0 ? void 0 : device.deviceId;
|
14174
14209
|
});
|
14175
14210
|
}
|
14211
|
+
hasDeviceInUse(kind) {
|
14212
|
+
return kind ? DeviceManager.userMediaPromiseMap.has(kind) : DeviceManager.userMediaPromiseMap.size > 0;
|
14213
|
+
}
|
14176
14214
|
}
|
14177
14215
|
DeviceManager.mediaDeviceKinds = ['audioinput', 'audiooutput', 'videoinput'];
|
14178
14216
|
DeviceManager.userMediaPromiseMap = new Map();
|
@@ -14209,52 +14247,6 @@ class LocalTrack extends Track {
|
|
14209
14247
|
this._mediaStreamTrack.removeEventListener('unmute', this.handleTrackUnmuteEvent);
|
14210
14248
|
this.emit(TrackEvent.Ended, this);
|
14211
14249
|
};
|
14212
|
-
/**
|
14213
|
-
* pauses publishing to the server without disabling the local MediaStreamTrack
|
14214
|
-
* this is used to display a user's own video locally while pausing publishing to
|
14215
|
-
* the server.
|
14216
|
-
* this API is unsupported on Safari < 12 due to a bug
|
14217
|
-
**/
|
14218
|
-
this.pauseUpstream = () => __awaiter(this, void 0, void 0, function* () {
|
14219
|
-
const unlock = yield this.pauseUpstreamLock.lock();
|
14220
|
-
try {
|
14221
|
-
if (this._isUpstreamPaused === true) {
|
14222
|
-
return;
|
14223
|
-
}
|
14224
|
-
if (!this.sender) {
|
14225
|
-
livekitLogger.warn('unable to pause upstream for an unpublished track');
|
14226
|
-
return;
|
14227
|
-
}
|
14228
|
-
this._isUpstreamPaused = true;
|
14229
|
-
this.emit(TrackEvent.UpstreamPaused, this);
|
14230
|
-
const browser = getBrowser();
|
14231
|
-
if ((browser === null || browser === void 0 ? void 0 : browser.name) === 'Safari' && compareVersions(browser.version, '12.0') < 0) {
|
14232
|
-
// https://bugs.webkit.org/show_bug.cgi?id=184911
|
14233
|
-
throw new DeviceUnsupportedError('pauseUpstream is not supported on Safari < 12.');
|
14234
|
-
}
|
14235
|
-
yield this.sender.replaceTrack(null);
|
14236
|
-
} finally {
|
14237
|
-
unlock();
|
14238
|
-
}
|
14239
|
-
});
|
14240
|
-
this.resumeUpstream = () => __awaiter(this, void 0, void 0, function* () {
|
14241
|
-
const unlock = yield this.pauseUpstreamLock.lock();
|
14242
|
-
try {
|
14243
|
-
if (this._isUpstreamPaused === false) {
|
14244
|
-
return;
|
14245
|
-
}
|
14246
|
-
if (!this.sender) {
|
14247
|
-
livekitLogger.warn('unable to resume upstream for an unpublished track');
|
14248
|
-
return;
|
14249
|
-
}
|
14250
|
-
this._isUpstreamPaused = false;
|
14251
|
-
this.emit(TrackEvent.UpstreamResumed, this);
|
14252
|
-
// this operation is noop if mediastreamtrack is already being sent
|
14253
|
-
yield this.sender.replaceTrack(this._mediaStreamTrack);
|
14254
|
-
} finally {
|
14255
|
-
unlock();
|
14256
|
-
}
|
14257
|
-
});
|
14258
14250
|
this.reacquireTrack = false;
|
14259
14251
|
this.providedByUser = userProvidedTrack;
|
14260
14252
|
this.muteLock = new Mutex();
|
@@ -14485,6 +14477,56 @@ class LocalTrack extends Track {
|
|
14485
14477
|
(_a = this.processor) === null || _a === void 0 ? void 0 : _a.destroy();
|
14486
14478
|
this.processor = undefined;
|
14487
14479
|
}
|
14480
|
+
/**
|
14481
|
+
* pauses publishing to the server without disabling the local MediaStreamTrack
|
14482
|
+
* this is used to display a user's own video locally while pausing publishing to
|
14483
|
+
* the server.
|
14484
|
+
* this API is unsupported on Safari < 12 due to a bug
|
14485
|
+
**/
|
14486
|
+
pauseUpstream() {
|
14487
|
+
return __awaiter(this, void 0, void 0, function* () {
|
14488
|
+
const unlock = yield this.pauseUpstreamLock.lock();
|
14489
|
+
try {
|
14490
|
+
if (this._isUpstreamPaused === true) {
|
14491
|
+
return;
|
14492
|
+
}
|
14493
|
+
if (!this.sender) {
|
14494
|
+
livekitLogger.warn('unable to pause upstream for an unpublished track');
|
14495
|
+
return;
|
14496
|
+
}
|
14497
|
+
this._isUpstreamPaused = true;
|
14498
|
+
this.emit(TrackEvent.UpstreamPaused, this);
|
14499
|
+
const browser = getBrowser();
|
14500
|
+
if ((browser === null || browser === void 0 ? void 0 : browser.name) === 'Safari' && compareVersions(browser.version, '12.0') < 0) {
|
14501
|
+
// https://bugs.webkit.org/show_bug.cgi?id=184911
|
14502
|
+
throw new DeviceUnsupportedError('pauseUpstream is not supported on Safari < 12.');
|
14503
|
+
}
|
14504
|
+
yield this.sender.replaceTrack(null);
|
14505
|
+
} finally {
|
14506
|
+
unlock();
|
14507
|
+
}
|
14508
|
+
});
|
14509
|
+
}
|
14510
|
+
resumeUpstream() {
|
14511
|
+
return __awaiter(this, void 0, void 0, function* () {
|
14512
|
+
const unlock = yield this.pauseUpstreamLock.lock();
|
14513
|
+
try {
|
14514
|
+
if (this._isUpstreamPaused === false) {
|
14515
|
+
return;
|
14516
|
+
}
|
14517
|
+
if (!this.sender) {
|
14518
|
+
livekitLogger.warn('unable to resume upstream for an unpublished track');
|
14519
|
+
return;
|
14520
|
+
}
|
14521
|
+
this._isUpstreamPaused = false;
|
14522
|
+
this.emit(TrackEvent.UpstreamResumed, this);
|
14523
|
+
// this operation is noop if mediastreamtrack is already being sent
|
14524
|
+
yield this.sender.replaceTrack(this._mediaStreamTrack);
|
14525
|
+
} finally {
|
14526
|
+
unlock();
|
14527
|
+
}
|
14528
|
+
});
|
14529
|
+
}
|
14488
14530
|
/**
|
14489
14531
|
* Sets a processor on this track.
|
14490
14532
|
* See https://github.com/livekit/track-processors-js for example usage
|
@@ -14659,6 +14701,16 @@ class E2EEManager extends eventsExports.EventEmitter {
|
|
14659
14701
|
}
|
14660
14702
|
});
|
14661
14703
|
}
|
14704
|
+
/**
|
14705
|
+
* @internal
|
14706
|
+
*/
|
14707
|
+
setSifTrailer(trailer) {
|
14708
|
+
if (!trailer || trailer.length === 0) {
|
14709
|
+
livekitLogger.warn("ignoring server sent trailer as it's empty");
|
14710
|
+
} else {
|
14711
|
+
this.postSifTrailer(trailer);
|
14712
|
+
}
|
14713
|
+
}
|
14662
14714
|
setupEngine(engine) {
|
14663
14715
|
engine.on(EngineEvent.RTPVideoMapUpdate, rtpMap => {
|
14664
14716
|
this.postRTPMap(rtpMap);
|
@@ -14738,6 +14790,18 @@ class E2EEManager extends eventsExports.EventEmitter {
|
|
14738
14790
|
};
|
14739
14791
|
this.worker.postMessage(msg);
|
14740
14792
|
}
|
14793
|
+
postSifTrailer(trailer) {
|
14794
|
+
if (!this.worker) {
|
14795
|
+
throw Error('could not post SIF trailer, worker is missing');
|
14796
|
+
}
|
14797
|
+
const msg = {
|
14798
|
+
kind: 'setSifTrailer',
|
14799
|
+
data: {
|
14800
|
+
trailer
|
14801
|
+
}
|
14802
|
+
};
|
14803
|
+
this.worker.postMessage(msg);
|
14804
|
+
}
|
14741
14805
|
setupE2EEReceiver(track, remoteId, trackInfo) {
|
14742
14806
|
if (!track.receiver) {
|
14743
14807
|
return;
|
@@ -14827,7 +14891,7 @@ class E2EEManager extends eventsExports.EventEmitter {
|
|
14827
14891
|
return;
|
14828
14892
|
}
|
14829
14893
|
if (isScriptTransformSupported()) {
|
14830
|
-
livekitLogger.
|
14894
|
+
livekitLogger.info('initialize script transform');
|
14831
14895
|
const options = {
|
14832
14896
|
kind: 'encode',
|
14833
14897
|
participantId,
|
@@ -14837,7 +14901,7 @@ class E2EEManager extends eventsExports.EventEmitter {
|
|
14837
14901
|
// @ts-ignore
|
14838
14902
|
sender.transform = new RTCRtpScriptTransform(this.worker, options);
|
14839
14903
|
} else {
|
14840
|
-
livekitLogger.
|
14904
|
+
livekitLogger.info('initialize encoded streams');
|
14841
14905
|
// @ts-ignore
|
14842
14906
|
const senderStreams = sender.createEncodedStreams();
|
14843
14907
|
const msg = {
|
@@ -15941,7 +16005,8 @@ const roomOptionDefaults = {
|
|
15941
16005
|
const roomConnectOptionDefaults = {
|
15942
16006
|
autoSubscribe: true,
|
15943
16007
|
maxRetries: 1,
|
15944
|
-
peerConnectionTimeout: 15000
|
16008
|
+
peerConnectionTimeout: 15000,
|
16009
|
+
websocketTimeout: 15000
|
15945
16010
|
};
|
15946
16011
|
|
15947
16012
|
const lossyDataChannel = '_lossy';
|
@@ -16139,8 +16204,10 @@ class RTCEngine extends eventsExports.EventEmitter {
|
|
16139
16204
|
this.url = url;
|
16140
16205
|
this.token = token;
|
16141
16206
|
this.signalOpts = opts;
|
16207
|
+
this.maxJoinAttempts = opts.maxRetries;
|
16142
16208
|
try {
|
16143
16209
|
this.joinAttempts += 1;
|
16210
|
+
this.setupSignalClientCallbacks();
|
16144
16211
|
const joinResponse = yield this.client.join(url, token, opts, abortSignal);
|
16145
16212
|
this._isClosed = false;
|
16146
16213
|
this.latestJoinResponse = joinResponse;
|
@@ -16152,7 +16219,6 @@ class RTCEngine extends eventsExports.EventEmitter {
|
|
16152
16219
|
if (!this.subscriberPrimary) {
|
16153
16220
|
this.negotiate();
|
16154
16221
|
}
|
16155
|
-
this.setupSignalClientCallbacks();
|
16156
16222
|
this.clientConfiguration = joinResponse.clientConfiguration;
|
16157
16223
|
return joinResponse;
|
16158
16224
|
} catch (e) {
|
@@ -17157,6 +17223,7 @@ class LocalAudioTrack extends LocalTrack {
|
|
17157
17223
|
*/
|
17158
17224
|
constructor(mediaTrack, constraints) {
|
17159
17225
|
let userProvidedTrack = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
17226
|
+
let audioContext = arguments.length > 3 ? arguments[3] : undefined;
|
17160
17227
|
super(mediaTrack, Track.Kind.Audio, constraints, userProvidedTrack);
|
17161
17228
|
/** @internal */
|
17162
17229
|
this.stopOnMute = false;
|
@@ -17179,6 +17246,7 @@ class LocalAudioTrack extends LocalTrack {
|
|
17179
17246
|
}
|
17180
17247
|
this.prevStats = stats;
|
17181
17248
|
});
|
17249
|
+
this.audioContext = audioContext;
|
17182
17250
|
this.checkForSilence();
|
17183
17251
|
}
|
17184
17252
|
setDeviceId(deviceId) {
|
@@ -17274,6 +17342,43 @@ class LocalAudioTrack extends LocalTrack {
|
|
17274
17342
|
this.monitorSender();
|
17275
17343
|
}, monitorFrequency);
|
17276
17344
|
}
|
17345
|
+
setProcessor(processor) {
|
17346
|
+
var _a;
|
17347
|
+
return __awaiter(this, void 0, void 0, function* () {
|
17348
|
+
const unlock = yield this.processorLock.lock();
|
17349
|
+
try {
|
17350
|
+
if (!this.audioContext) {
|
17351
|
+
throw Error('Audio context needs to be set on LocalAudioTrack in order to enable processors');
|
17352
|
+
}
|
17353
|
+
if (this.processor) {
|
17354
|
+
yield this.stopProcessor();
|
17355
|
+
}
|
17356
|
+
if (this.kind === 'unknown') {
|
17357
|
+
throw TypeError('cannot set processor on track of unknown kind');
|
17358
|
+
}
|
17359
|
+
const processorOptions = {
|
17360
|
+
kind: this.kind,
|
17361
|
+
track: this._mediaStreamTrack,
|
17362
|
+
audioContext: this.audioContext
|
17363
|
+
};
|
17364
|
+
livekitLogger.debug("setting up audio processor ".concat(processor.name));
|
17365
|
+
yield processor.init(processorOptions);
|
17366
|
+
this.processor = processor;
|
17367
|
+
if (this.processor.processedTrack) {
|
17368
|
+
yield (_a = this.sender) === null || _a === void 0 ? void 0 : _a.replaceTrack(this.processor.processedTrack);
|
17369
|
+
}
|
17370
|
+
} finally {
|
17371
|
+
unlock();
|
17372
|
+
}
|
17373
|
+
});
|
17374
|
+
}
|
17375
|
+
/**
|
17376
|
+
* @internal
|
17377
|
+
* @experimental
|
17378
|
+
*/
|
17379
|
+
setAudioContext(audioContext) {
|
17380
|
+
this.audioContext = audioContext;
|
17381
|
+
}
|
17277
17382
|
getSenderStats() {
|
17278
17383
|
var _a;
|
17279
17384
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -17687,6 +17792,66 @@ class LocalVideoTrack extends LocalTrack {
|
|
17687
17792
|
});
|
17688
17793
|
super.stop();
|
17689
17794
|
}
|
17795
|
+
pauseUpstream() {
|
17796
|
+
const _super = Object.create(null, {
|
17797
|
+
pauseUpstream: {
|
17798
|
+
get: () => super.pauseUpstream
|
17799
|
+
}
|
17800
|
+
});
|
17801
|
+
var _a, e_1, _b, _c;
|
17802
|
+
var _d;
|
17803
|
+
return __awaiter(this, void 0, void 0, function* () {
|
17804
|
+
yield _super.pauseUpstream.call(this);
|
17805
|
+
try {
|
17806
|
+
for (var _e = true, _f = __asyncValues(this.simulcastCodecs.values()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {
|
17807
|
+
_c = _g.value;
|
17808
|
+
_e = false;
|
17809
|
+
const sc = _c;
|
17810
|
+
yield (_d = sc.sender) === null || _d === void 0 ? void 0 : _d.replaceTrack(null);
|
17811
|
+
}
|
17812
|
+
} catch (e_1_1) {
|
17813
|
+
e_1 = {
|
17814
|
+
error: e_1_1
|
17815
|
+
};
|
17816
|
+
} finally {
|
17817
|
+
try {
|
17818
|
+
if (!_e && !_a && (_b = _f.return)) yield _b.call(_f);
|
17819
|
+
} finally {
|
17820
|
+
if (e_1) throw e_1.error;
|
17821
|
+
}
|
17822
|
+
}
|
17823
|
+
});
|
17824
|
+
}
|
17825
|
+
resumeUpstream() {
|
17826
|
+
const _super = Object.create(null, {
|
17827
|
+
resumeUpstream: {
|
17828
|
+
get: () => super.resumeUpstream
|
17829
|
+
}
|
17830
|
+
});
|
17831
|
+
var _a, e_2, _b, _c;
|
17832
|
+
var _d;
|
17833
|
+
return __awaiter(this, void 0, void 0, function* () {
|
17834
|
+
yield _super.resumeUpstream.call(this);
|
17835
|
+
try {
|
17836
|
+
for (var _e = true, _f = __asyncValues(this.simulcastCodecs.values()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {
|
17837
|
+
_c = _g.value;
|
17838
|
+
_e = false;
|
17839
|
+
const sc = _c;
|
17840
|
+
yield (_d = sc.sender) === null || _d === void 0 ? void 0 : _d.replaceTrack(sc.mediaStreamTrack);
|
17841
|
+
}
|
17842
|
+
} catch (e_2_1) {
|
17843
|
+
e_2 = {
|
17844
|
+
error: e_2_1
|
17845
|
+
};
|
17846
|
+
} finally {
|
17847
|
+
try {
|
17848
|
+
if (!_e && !_a && (_b = _f.return)) yield _b.call(_f);
|
17849
|
+
} finally {
|
17850
|
+
if (e_2) throw e_2.error;
|
17851
|
+
}
|
17852
|
+
}
|
17853
|
+
});
|
17854
|
+
}
|
17690
17855
|
mute() {
|
17691
17856
|
const _super = Object.create(null, {
|
17692
17857
|
mute: {
|
@@ -17728,6 +17893,12 @@ class LocalVideoTrack extends LocalTrack {
|
|
17728
17893
|
}
|
17729
17894
|
});
|
17730
17895
|
}
|
17896
|
+
setTrackMuted(muted) {
|
17897
|
+
super.setTrackMuted(muted);
|
17898
|
+
for (const sc of this.simulcastCodecs.values()) {
|
17899
|
+
sc.mediaStreamTrack.enabled = !muted;
|
17900
|
+
}
|
17901
|
+
}
|
17731
17902
|
getSenderStats() {
|
17732
17903
|
var _a;
|
17733
17904
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -17795,6 +17966,7 @@ class LocalVideoTrack extends LocalTrack {
|
|
17795
17966
|
});
|
17796
17967
|
}
|
17797
17968
|
restartTrack(options) {
|
17969
|
+
var _a, e_3, _b, _c;
|
17798
17970
|
return __awaiter(this, void 0, void 0, function* () {
|
17799
17971
|
let constraints;
|
17800
17972
|
if (options) {
|
@@ -17806,6 +17978,60 @@ class LocalVideoTrack extends LocalTrack {
|
|
17806
17978
|
}
|
17807
17979
|
}
|
17808
17980
|
yield this.restart(constraints);
|
17981
|
+
try {
|
17982
|
+
for (var _d = true, _e = __asyncValues(this.simulcastCodecs.values()), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
|
17983
|
+
_c = _f.value;
|
17984
|
+
_d = false;
|
17985
|
+
const sc = _c;
|
17986
|
+
if (sc.sender) {
|
17987
|
+
sc.mediaStreamTrack = this.mediaStreamTrack.clone();
|
17988
|
+
yield sc.sender.replaceTrack(sc.mediaStreamTrack);
|
17989
|
+
}
|
17990
|
+
}
|
17991
|
+
} catch (e_3_1) {
|
17992
|
+
e_3 = {
|
17993
|
+
error: e_3_1
|
17994
|
+
};
|
17995
|
+
} finally {
|
17996
|
+
try {
|
17997
|
+
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
17998
|
+
} finally {
|
17999
|
+
if (e_3) throw e_3.error;
|
18000
|
+
}
|
18001
|
+
}
|
18002
|
+
});
|
18003
|
+
}
|
18004
|
+
setProcessor(processor) {
|
18005
|
+
let showProcessedStreamLocally = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
18006
|
+
const _super = Object.create(null, {
|
18007
|
+
setProcessor: {
|
18008
|
+
get: () => super.setProcessor
|
18009
|
+
}
|
18010
|
+
});
|
18011
|
+
var _a, e_4, _b, _c;
|
18012
|
+
var _d, _e;
|
18013
|
+
return __awaiter(this, void 0, void 0, function* () {
|
18014
|
+
yield _super.setProcessor.call(this, processor, showProcessedStreamLocally);
|
18015
|
+
if ((_d = this.processor) === null || _d === void 0 ? void 0 : _d.processedTrack) {
|
18016
|
+
try {
|
18017
|
+
for (var _f = true, _g = __asyncValues(this.simulcastCodecs.values()), _h; _h = yield _g.next(), _a = _h.done, !_a; _f = true) {
|
18018
|
+
_c = _h.value;
|
18019
|
+
_f = false;
|
18020
|
+
const sc = _c;
|
18021
|
+
yield (_e = sc.sender) === null || _e === void 0 ? void 0 : _e.replaceTrack(this.processor.processedTrack);
|
18022
|
+
}
|
18023
|
+
} catch (e_4_1) {
|
18024
|
+
e_4 = {
|
18025
|
+
error: e_4_1
|
18026
|
+
};
|
18027
|
+
} finally {
|
18028
|
+
try {
|
18029
|
+
if (!_f && !_a && (_b = _g.return)) yield _b.call(_g);
|
18030
|
+
} finally {
|
18031
|
+
if (e_4) throw e_4.error;
|
18032
|
+
}
|
18033
|
+
}
|
18034
|
+
}
|
17809
18035
|
});
|
17810
18036
|
}
|
17811
18037
|
addSimulcastTrack(codec, encodings) {
|
@@ -17841,7 +18067,7 @@ class LocalVideoTrack extends LocalTrack {
|
|
17841
18067
|
*/
|
17842
18068
|
setPublishingCodecs(codecs) {
|
17843
18069
|
var _a, codecs_1, codecs_1_1;
|
17844
|
-
var _b,
|
18070
|
+
var _b, e_5, _c, _d;
|
17845
18071
|
return __awaiter(this, void 0, void 0, function* () {
|
17846
18072
|
livekitLogger.debug('setting publishing codecs', {
|
17847
18073
|
codecs,
|
@@ -17877,15 +18103,15 @@ class LocalVideoTrack extends LocalTrack {
|
|
17877
18103
|
}
|
17878
18104
|
}
|
17879
18105
|
}
|
17880
|
-
} catch (
|
17881
|
-
|
17882
|
-
error:
|
18106
|
+
} catch (e_5_1) {
|
18107
|
+
e_5 = {
|
18108
|
+
error: e_5_1
|
17883
18109
|
};
|
17884
18110
|
} finally {
|
17885
18111
|
try {
|
17886
18112
|
if (!_a && !_b && (_c = codecs_1.return)) yield _c.call(codecs_1);
|
17887
18113
|
} finally {
|
17888
|
-
if (
|
18114
|
+
if (e_5) throw e_5.error;
|
17889
18115
|
}
|
17890
18116
|
}
|
17891
18117
|
return newCodecs;
|
@@ -18121,6 +18347,10 @@ class RemoteAudioTrack extends RemoteTrack {
|
|
18121
18347
|
el.volume = volume;
|
18122
18348
|
}
|
18123
18349
|
}
|
18350
|
+
if (isReactNative()) {
|
18351
|
+
// @ts-ignore
|
18352
|
+
this._mediaStreamTrack._setVolume(volume);
|
18353
|
+
}
|
18124
18354
|
this.elementVolume = volume;
|
18125
18355
|
}
|
18126
18356
|
/**
|
@@ -18130,6 +18360,10 @@ class RemoteAudioTrack extends RemoteTrack {
|
|
18130
18360
|
if (this.elementVolume) {
|
18131
18361
|
return this.elementVolume;
|
18132
18362
|
}
|
18363
|
+
if (isReactNative()) {
|
18364
|
+
// RN volume value defaults to 1.0 if hasn't been changed.
|
18365
|
+
return 1.0;
|
18366
|
+
}
|
18133
18367
|
let highestVolume = 0;
|
18134
18368
|
this.attachedElements.forEach(element => {
|
18135
18369
|
if (element.volume > highestVolume) {
|
@@ -18923,6 +19157,13 @@ class Participant extends eventsExports.EventEmitter {
|
|
18923
19157
|
this.emit(ParticipantEvent.ConnectionQualityChanged, this._connectionQuality);
|
18924
19158
|
}
|
18925
19159
|
}
|
19160
|
+
/**
|
19161
|
+
* @internal
|
19162
|
+
*/
|
19163
|
+
setAudioContext(ctx) {
|
19164
|
+
this.audioContext = ctx;
|
19165
|
+
this.audioTracks.forEach(track => (track.track instanceof RemoteAudioTrack || track.track instanceof LocalAudioTrack) && track.track.setAudioContext(ctx));
|
19166
|
+
}
|
18926
19167
|
addTrackPublication(publication) {
|
18927
19168
|
// forward publication driven events
|
18928
19169
|
publication.on(TrackEvent.Muted, () => {
|
@@ -19192,8 +19433,8 @@ class RemoteTrackPublication extends TrackPublication {
|
|
19192
19433
|
fps: this.fps
|
19193
19434
|
});
|
19194
19435
|
if (this.videoDimensions) {
|
19195
|
-
settings.width = this.videoDimensions.width;
|
19196
|
-
settings.height = this.videoDimensions.height;
|
19436
|
+
settings.width = Math.ceil(this.videoDimensions.width);
|
19437
|
+
settings.height = Math.ceil(this.videoDimensions.height);
|
19197
19438
|
} else if (this.currentVideoQuality !== undefined) {
|
19198
19439
|
settings.quality = this.currentVideoQuality;
|
19199
19440
|
} else {
|
@@ -19436,13 +19677,6 @@ class RemoteParticipant extends Participant {
|
|
19436
19677
|
this.emit(ParticipantEvent.TrackUnpublished, publication);
|
19437
19678
|
}
|
19438
19679
|
}
|
19439
|
-
/**
|
19440
|
-
* @internal
|
19441
|
-
*/
|
19442
|
-
setAudioContext(ctx) {
|
19443
|
-
this.audioContext = ctx;
|
19444
|
-
this.audioTracks.forEach(track => track.track instanceof RemoteAudioTrack && track.track.setAudioContext(ctx));
|
19445
|
-
}
|
19446
19680
|
/**
|
19447
19681
|
* @internal
|
19448
19682
|
*/
|
@@ -19914,7 +20148,7 @@ class LocalParticipant extends Participant {
|
|
19914
20148
|
screenVideo.source = Track.Source.ScreenShare;
|
19915
20149
|
const localTracks = [screenVideo];
|
19916
20150
|
if (stream.getAudioTracks().length > 0) {
|
19917
|
-
const screenAudio = new LocalAudioTrack(stream.getAudioTracks()[0], undefined, false);
|
20151
|
+
const screenAudio = new LocalAudioTrack(stream.getAudioTracks()[0], undefined, false, this.audioContext);
|
19918
20152
|
screenAudio.source = Track.Source.ScreenShareAudio;
|
19919
20153
|
localTracks.push(screenAudio);
|
19920
20154
|
}
|
@@ -19958,7 +20192,7 @@ class LocalParticipant extends Participant {
|
|
19958
20192
|
if (track instanceof MediaStreamTrack) {
|
19959
20193
|
switch (track.kind) {
|
19960
20194
|
case 'audio':
|
19961
|
-
track = new LocalAudioTrack(track, defaultConstraints, true);
|
20195
|
+
track = new LocalAudioTrack(track, defaultConstraints, true, this.audioContext);
|
19962
20196
|
break;
|
19963
20197
|
case 'video':
|
19964
20198
|
track = new LocalVideoTrack(track, defaultConstraints, true);
|
@@ -19967,6 +20201,9 @@ class LocalParticipant extends Participant {
|
|
19967
20201
|
throw new TrackInvalidError("unsupported MediaStreamTrack kind ".concat(track.kind));
|
19968
20202
|
}
|
19969
20203
|
}
|
20204
|
+
if (track instanceof LocalAudioTrack) {
|
20205
|
+
track.setAudioContext(this.audioContext);
|
20206
|
+
}
|
19970
20207
|
// is it already published? if so skip
|
19971
20208
|
let existingPublication;
|
19972
20209
|
this.tracks.forEach(publication => {
|
@@ -20104,6 +20341,9 @@ class LocalParticipant extends Participant {
|
|
20104
20341
|
}
|
20105
20342
|
// set up backup
|
20106
20343
|
if (opts.videoCodec && opts.backupCodec && opts.videoCodec !== opts.backupCodec.codec) {
|
20344
|
+
if (!this.roomOptions.dynacast) {
|
20345
|
+
this.roomOptions.dynacast = true;
|
20346
|
+
}
|
20107
20347
|
const simOpts = Object.assign({}, opts);
|
20108
20348
|
simOpts.simulcast = true;
|
20109
20349
|
simEncodings = computeTrackBackupEncodings(track, opts.backupCodec.codec, simOpts);
|
@@ -20602,11 +20842,13 @@ class Room extends eventsExports.EventEmitter {
|
|
20602
20842
|
if (this.abortController) {
|
20603
20843
|
this.abortController.abort();
|
20604
20844
|
}
|
20605
|
-
|
20845
|
+
// explicit creation as local var needed to satisfy TS compiler when passing it to `attemptConnection` further down
|
20846
|
+
const abortController = new AbortController();
|
20847
|
+
this.abortController = abortController;
|
20606
20848
|
// at this point the intention to connect has been signalled so we can allow cancelling of the connection via disconnect() again
|
20607
20849
|
unlockDisconnect === null || unlockDisconnect === void 0 ? void 0 : unlockDisconnect();
|
20608
20850
|
try {
|
20609
|
-
yield this.attemptConnection(regionUrl !== null && regionUrl !== void 0 ? regionUrl : url, token, opts,
|
20851
|
+
yield this.attemptConnection(regionUrl !== null && regionUrl !== void 0 ? regionUrl : url, token, opts, abortController);
|
20610
20852
|
this.abortController = undefined;
|
20611
20853
|
resolve();
|
20612
20854
|
} catch (e) {
|
@@ -20648,7 +20890,8 @@ class Room extends eventsExports.EventEmitter {
|
|
20648
20890
|
publishOnly: connectOptions.publishOnly,
|
20649
20891
|
adaptiveStream: typeof roomOptions.adaptiveStream === 'object' ? true : roomOptions.adaptiveStream,
|
20650
20892
|
maxRetries: connectOptions.maxRetries,
|
20651
|
-
e2eeEnabled: !!this.e2eeManager
|
20893
|
+
e2eeEnabled: !!this.e2eeManager,
|
20894
|
+
websocketTimeout: connectOptions.websocketTimeout
|
20652
20895
|
}, abortController.signal);
|
20653
20896
|
let serverInfo = joinResponse.serverInfo;
|
20654
20897
|
if (!serverInfo) {
|
@@ -20680,6 +20923,9 @@ class Room extends eventsExports.EventEmitter {
|
|
20680
20923
|
if (joinResponse.room) {
|
20681
20924
|
this.handleRoomUpdate(joinResponse.room);
|
20682
20925
|
}
|
20926
|
+
if (this.options.e2ee && this.e2eeManager) {
|
20927
|
+
this.e2eeManager.setSifTrailer(joinResponse.sifTrailer);
|
20928
|
+
}
|
20683
20929
|
};
|
20684
20930
|
this.attemptConnection = (url, token, opts, abortController) => __awaiter(this, void 0, void 0, function* () {
|
20685
20931
|
var _d, _e;
|
@@ -21258,7 +21504,7 @@ class Room extends eventsExports.EventEmitter {
|
|
21258
21504
|
/**
|
21259
21505
|
* @internal for testing
|
21260
21506
|
*/
|
21261
|
-
simulateScenario(scenario) {
|
21507
|
+
simulateScenario(scenario, arg) {
|
21262
21508
|
return __awaiter(this, void 0, void 0, function* () {
|
21263
21509
|
let postAction = () => {};
|
21264
21510
|
let req;
|
@@ -21327,6 +21573,17 @@ class Room extends eventsExports.EventEmitter {
|
|
21327
21573
|
}
|
21328
21574
|
});
|
21329
21575
|
break;
|
21576
|
+
case 'subscriber-bandwidth':
|
21577
|
+
if (arg === undefined || typeof arg !== 'number') {
|
21578
|
+
throw new Error('subscriber-bandwidth requires a number as argument');
|
21579
|
+
}
|
21580
|
+
req = new SimulateScenario({
|
21581
|
+
scenario: {
|
21582
|
+
case: 'subscriberBandwidth',
|
21583
|
+
value: BigInt(arg)
|
21584
|
+
}
|
21585
|
+
});
|
21586
|
+
break;
|
21330
21587
|
}
|
21331
21588
|
if (req) {
|
21332
21589
|
this.engine.client.sendSimulateScenario(req);
|
@@ -21343,7 +21600,6 @@ class Room extends eventsExports.EventEmitter {
|
|
21343
21600
|
*/
|
21344
21601
|
startAudio() {
|
21345
21602
|
return __awaiter(this, void 0, void 0, function* () {
|
21346
|
-
yield this.acquireAudioContext();
|
21347
21603
|
const elements = [];
|
21348
21604
|
const browser = getBrowser();
|
21349
21605
|
if (browser && browser.os === 'iOS') {
|
@@ -21390,10 +21646,10 @@ class Room extends eventsExports.EventEmitter {
|
|
21390
21646
|
});
|
21391
21647
|
});
|
21392
21648
|
try {
|
21393
|
-
yield Promise.all(elements.map(e => {
|
21649
|
+
yield Promise.all([this.acquireAudioContext(), ...elements.map(e => {
|
21394
21650
|
e.muted = false;
|
21395
21651
|
return e.play();
|
21396
|
-
}));
|
21652
|
+
})]);
|
21397
21653
|
this.handleAudioPlaybackStarted();
|
21398
21654
|
} catch (err) {
|
21399
21655
|
this.handleAudioPlaybackFailed(err);
|
@@ -21634,6 +21890,7 @@ class Room extends eventsExports.EventEmitter {
|
|
21634
21890
|
if (this.options.expWebAudioMix) {
|
21635
21891
|
this.participants.forEach(participant => participant.setAudioContext(this.audioContext));
|
21636
21892
|
}
|
21893
|
+
this.localParticipant.setAudioContext(this.audioContext);
|
21637
21894
|
const newContextIsRunning = ((_b = this.audioContext) === null || _b === void 0 ? void 0 : _b.state) === 'running';
|
21638
21895
|
if (newContextIsRunning !== this.canPlaybackAudio) {
|
21639
21896
|
this.audioEnabled = newContextIsRunning;
|
@@ -22262,7 +22519,8 @@ class TURNCheck extends Checker {
|
|
22262
22519
|
const joinRes = yield signalClient.join(this.url, this.token, {
|
22263
22520
|
autoSubscribe: true,
|
22264
22521
|
maxRetries: 0,
|
22265
|
-
e2eeEnabled: false
|
22522
|
+
e2eeEnabled: false,
|
22523
|
+
websocketTimeout: 15000
|
22266
22524
|
});
|
22267
22525
|
let hasTLS = false;
|
22268
22526
|
let hasTURN = false;
|
@@ -22314,18 +22572,19 @@ class WebRTCCheck extends Checker {
|
|
22314
22572
|
this.room.on(RoomEvent.SignalConnected, () => {
|
22315
22573
|
const prevTrickle = this.room.engine.client.onTrickle;
|
22316
22574
|
this.room.engine.client.onTrickle = (sd, target) => {
|
22317
|
-
console.log('got candidate', sd);
|
22318
22575
|
if (sd.candidate) {
|
22319
22576
|
const candidate = new RTCIceCandidate(sd);
|
22320
22577
|
let str = "".concat(candidate.protocol, " ").concat(candidate.address, ":").concat(candidate.port, " ").concat(candidate.type);
|
22321
|
-
if (candidate.
|
22322
|
-
hasTcp = true;
|
22323
|
-
str += ' (active)';
|
22324
|
-
} else if (candidate.protocol === 'udp' && candidate.address) {
|
22578
|
+
if (candidate.address) {
|
22325
22579
|
if (isIPPrivate(candidate.address)) {
|
22326
22580
|
str += ' (private)';
|
22327
22581
|
} else {
|
22328
|
-
|
22582
|
+
if (candidate.protocol === 'tcp' && candidate.tcpType === 'passive') {
|
22583
|
+
hasTcp = true;
|
22584
|
+
str += ' (passive)';
|
22585
|
+
} else if (candidate.protocol === 'udp') {
|
22586
|
+
hasIpv4Udp = true;
|
22587
|
+
}
|
22329
22588
|
}
|
22330
22589
|
}
|
22331
22590
|
this.appendMessage(str);
|
@@ -22344,7 +22603,7 @@ class WebRTCCheck extends Checker {
|
|
22344
22603
|
});
|
22345
22604
|
try {
|
22346
22605
|
yield this.connect();
|
22347
|
-
|
22606
|
+
livekitLogger.info('now the room is connected');
|
22348
22607
|
} catch (err) {
|
22349
22608
|
this.appendWarning('ports need to be open on firewall in order to connect.');
|
22350
22609
|
throw err;
|
@@ -22389,7 +22648,8 @@ class WebSocketCheck extends Checker {
|
|
22389
22648
|
const joinRes = yield signalClient.join(this.url, this.token, {
|
22390
22649
|
autoSubscribe: true,
|
22391
22650
|
maxRetries: 0,
|
22392
|
-
e2eeEnabled: false
|
22651
|
+
e2eeEnabled: false,
|
22652
|
+
websocketTimeout: 15000
|
22393
22653
|
});
|
22394
22654
|
this.appendMessage("Connected to server, version ".concat(joinRes.serverVersion, "."));
|
22395
22655
|
if (((_a = joinRes.serverInfo) === null || _a === void 0 ? void 0 : _a.edition) === ServerInfo_Edition.Cloud && ((_b = joinRes.serverInfo) === null || _b === void 0 ? void 0 : _b.region)) {
|
@@ -22553,5 +22813,5 @@ function isFacingModeValue(item) {
|
|
22553
22813
|
return item === undefined || allowedValues.includes(item);
|
22554
22814
|
}
|
22555
22815
|
|
22556
|
-
export { AudioPresets, BaseKeyProvider, ConnectionCheck, ConnectionError, ConnectionQuality, ConnectionState, CriticalTimers, CryptorEvent, DataPacket_Kind, DefaultReconnectPolicy, DeviceUnsupportedError, DisconnectReason, EncryptionEvent, EngineEvent, ExternalE2EEKeyProvider, LivekitError, LocalAudioTrack, LocalParticipant, LocalTrack, LocalTrackPublication, LocalVideoTrack, LogLevel, MediaDeviceFailure, NegotiationError, Participant, ParticipantEvent, PublishDataError, RemoteAudioTrack, RemoteParticipant, RemoteTrack, RemoteTrackPublication, RemoteVideoTrack, Room, RoomEvent, RoomState, ScreenSharePresets, Track, TrackEvent, TrackInvalidError, TrackPublication, UnexpectedConnectionState, UnsupportedServer, VideoPreset, VideoPresets, VideoPresets43, VideoQuality, attachToElement, createAudioAnalyser, createE2EEKey, createKeyMaterialFromString, createLocalAudioTrack, createLocalScreenTracks, createLocalTracks, createLocalVideoTrack, deriveKeys, detachTrack, facingModeFromDeviceLabel, facingModeFromLocalTrack, getEmptyAudioStreamTrack, getEmptyVideoStreamTrack, importKey, isBackupCodec, isBrowserSupported, isCodecEqual, isE2EESupported, isInsertableStreamSupported, isScriptTransformSupported, isVideoFrame, mimeTypeToVideoCodecString, protocolVersion, ratchet, setLogExtension, setLogLevel, supportsAV1, supportsAdaptiveStream, supportsDynacast, supportsVP9, version, videoCodecs };
|
22816
|
+
export { AudioPresets, BaseKeyProvider, ConnectionCheck, ConnectionError, ConnectionQuality, ConnectionState, CriticalTimers, CryptorEvent, DataPacket_Kind, DefaultReconnectPolicy, DeviceUnsupportedError, DisconnectReason, EncryptionEvent, EngineEvent, ExternalE2EEKeyProvider, LivekitError, LocalAudioTrack, LocalParticipant, LocalTrack, LocalTrackPublication, LocalVideoTrack, LogLevel, MediaDeviceFailure, NegotiationError, Participant, ParticipantEvent, PublishDataError, RemoteAudioTrack, RemoteParticipant, RemoteTrack, RemoteTrackPublication, RemoteVideoTrack, Room, RoomEvent, RoomState, ScreenSharePresets, Track, TrackEvent, TrackInvalidError, TrackPublication, UnexpectedConnectionState, UnsupportedServer, VideoPreset, VideoPresets, VideoPresets43, VideoQuality, attachToElement, createAudioAnalyser, createE2EEKey, createKeyMaterialFromBuffer, createKeyMaterialFromString, createLocalAudioTrack, createLocalScreenTracks, createLocalTracks, createLocalVideoTrack, deriveKeys, detachTrack, facingModeFromDeviceLabel, facingModeFromLocalTrack, getEmptyAudioStreamTrack, getEmptyVideoStreamTrack, importKey, isBackupCodec, isBrowserSupported, isCodecEqual, isE2EESupported, isInsertableStreamSupported, isScriptTransformSupported, isVideoFrame, mimeTypeToVideoCodecString, protocolVersion, ratchet, setLogExtension, setLogLevel, supportsAV1, supportsAdaptiveStream, supportsDynacast, supportsVP9, version, videoCodecs };
|
22557
22817
|
//# sourceMappingURL=livekit-client.esm.mjs.map
|