livekit-client 2.15.6 → 2.15.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/livekit-client.esm.mjs +20 -25
- 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/PCTransport.d.ts.map +1 -1
- package/dist/src/room/participant/LocalParticipant.d.ts +1 -3
- package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
- package/dist/ts4.2/src/room/participant/LocalParticipant.d.ts +1 -3
- package/package.json +4 -3
- package/src/room/PCTransport.ts +14 -5
- package/src/room/Room.ts +1 -1
- package/src/room/participant/LocalParticipant.ts +9 -23
@@ -11388,7 +11388,7 @@ function getOSVersion(ua) {
|
|
11388
11388
|
return ua.includes('mac os') ? getMatch(/\(.+?(\d+_\d+(:?_\d+)?)/, ua, 1).replace(/_/g, '.') : undefined;
|
11389
11389
|
}
|
11390
11390
|
|
11391
|
-
var version$1 = "2.15.
|
11391
|
+
var version$1 = "2.15.7";
|
11392
11392
|
|
11393
11393
|
const version = version$1;
|
11394
11394
|
const protocolVersion = 16;
|
@@ -14970,10 +14970,11 @@ class PCTransport extends eventsExports.EventEmitter {
|
|
14970
14970
|
} else if (sd.type === 'answer') {
|
14971
14971
|
const sdpParsed = libExports.parse((_a = sd.sdp) !== null && _a !== void 0 ? _a : '');
|
14972
14972
|
sdpParsed.media.forEach(media => {
|
14973
|
+
const mid = getMidString(media.mid);
|
14973
14974
|
if (media.type === 'audio') {
|
14974
14975
|
// mung sdp for opus bitrate settings
|
14975
14976
|
this.trackBitrates.some(trackbr => {
|
14976
|
-
if (!trackbr.transceiver ||
|
14977
|
+
if (!trackbr.transceiver || mid != trackbr.transceiver.mid) {
|
14977
14978
|
return false;
|
14978
14979
|
}
|
14979
14980
|
let codecPayload = 0;
|
@@ -15324,6 +15325,8 @@ class PCTransport extends eventsExports.EventEmitter {
|
|
15324
15325
|
}
|
15325
15326
|
}
|
15326
15327
|
function ensureAudioNackAndStereo(media, stereoMids, nackMids) {
|
15328
|
+
// sdp-transform types don't include number however the parser outputs mids as numbers in some cases
|
15329
|
+
const mid = getMidString(media.mid);
|
15327
15330
|
// found opus codec to add nack fb
|
15328
15331
|
let opusPayload = 0;
|
15329
15332
|
media.rtp.some(rtp => {
|
@@ -15338,13 +15341,13 @@ function ensureAudioNackAndStereo(media, stereoMids, nackMids) {
|
|
15338
15341
|
if (!media.rtcpFb) {
|
15339
15342
|
media.rtcpFb = [];
|
15340
15343
|
}
|
15341
|
-
if (nackMids.includes(
|
15344
|
+
if (nackMids.includes(mid) && !media.rtcpFb.some(fb => fb.payload === opusPayload && fb.type === 'nack')) {
|
15342
15345
|
media.rtcpFb.push({
|
15343
15346
|
payload: opusPayload,
|
15344
15347
|
type: 'nack'
|
15345
15348
|
});
|
15346
15349
|
}
|
15347
|
-
if (stereoMids.includes(
|
15350
|
+
if (stereoMids.includes(mid)) {
|
15348
15351
|
media.fmtp.some(fmtp => {
|
15349
15352
|
if (fmtp.payload === opusPayload) {
|
15350
15353
|
if (!fmtp.config.includes('stereo=1')) {
|
@@ -15365,6 +15368,7 @@ function extractStereoAndNackAudioFromOffer(offer) {
|
|
15365
15368
|
let opusPayload = 0;
|
15366
15369
|
sdpParsed.media.forEach(media => {
|
15367
15370
|
var _a;
|
15371
|
+
const mid = getMidString(media.mid);
|
15368
15372
|
if (media.type === 'audio') {
|
15369
15373
|
media.rtp.some(rtp => {
|
15370
15374
|
if (rtp.codec === 'opus') {
|
@@ -15374,12 +15378,12 @@ function extractStereoAndNackAudioFromOffer(offer) {
|
|
15374
15378
|
return false;
|
15375
15379
|
});
|
15376
15380
|
if ((_a = media.rtcpFb) === null || _a === void 0 ? void 0 : _a.some(fb => fb.payload === opusPayload && fb.type === 'nack')) {
|
15377
|
-
nackMids.push(
|
15381
|
+
nackMids.push(mid);
|
15378
15382
|
}
|
15379
15383
|
media.fmtp.some(fmtp => {
|
15380
15384
|
if (fmtp.payload === opusPayload) {
|
15381
15385
|
if (fmtp.config.includes('sprop-stereo=1')) {
|
15382
|
-
stereoMids.push(
|
15386
|
+
stereoMids.push(mid);
|
15383
15387
|
}
|
15384
15388
|
return true;
|
15385
15389
|
}
|
@@ -15405,6 +15409,9 @@ function ensureIPAddrMatchVersion(media) {
|
|
15405
15409
|
}
|
15406
15410
|
}
|
15407
15411
|
}
|
15412
|
+
function getMidString(mid) {
|
15413
|
+
return typeof mid === 'number' ? mid.toFixed(0) : mid;
|
15414
|
+
}
|
15408
15415
|
|
15409
15416
|
const defaultVideoCodec = 'vp8';
|
15410
15417
|
const publishDefaults = {
|
@@ -21569,15 +21576,6 @@ class LocalParticipant extends Participant {
|
|
21569
21576
|
return this.setTrackEnabled(Track.Source.ScreenShare, enabled, options, publishOptions);
|
21570
21577
|
}
|
21571
21578
|
/** @internal */
|
21572
|
-
setPermissions(permissions) {
|
21573
|
-
const prevPermissions = this.permissions;
|
21574
|
-
const changed = super.setPermissions(permissions);
|
21575
|
-
if (changed && prevPermissions) {
|
21576
|
-
this.emit(ParticipantEvent.ParticipantPermissionsChanged, prevPermissions);
|
21577
|
-
}
|
21578
|
-
return changed;
|
21579
|
-
}
|
21580
|
-
/** @internal */
|
21581
21579
|
setE2EEEnabled(enabled) {
|
21582
21580
|
return __awaiter(this, void 0, void 0, function* () {
|
21583
21581
|
this.encryptionType = enabled ? Encryption_Type.GCM : Encryption_Type.NONE;
|
@@ -21888,25 +21886,22 @@ class LocalParticipant extends Participant {
|
|
21888
21886
|
_this2.log.warn('track has already been published, skipping', Object.assign(Object.assign({}, _this2.logContext), getLogContextFromTrack(existingPublication)));
|
21889
21887
|
return existingPublication;
|
21890
21888
|
}
|
21889
|
+
const opts = Object.assign(Object.assign({}, _this2.roomOptions.publishDefaults), options);
|
21891
21890
|
const isStereoInput = 'channelCount' in track.mediaStreamTrack.getSettings() &&
|
21892
21891
|
// @ts-ignore `channelCount` on getSettings() is currently only available for Safari, but is generally the best way to determine a stereo track https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSettings/channelCount
|
21893
21892
|
track.mediaStreamTrack.getSettings().channelCount === 2 || track.mediaStreamTrack.getConstraints().channelCount === 2;
|
21894
|
-
const isStereo = (_b =
|
21893
|
+
const isStereo = (_b = opts.forceStereo) !== null && _b !== void 0 ? _b : isStereoInput;
|
21895
21894
|
// disable dtx for stereo track if not enabled explicitly
|
21896
21895
|
if (isStereo) {
|
21897
|
-
if (
|
21898
|
-
options = {};
|
21899
|
-
}
|
21900
|
-
if (options.dtx === undefined) {
|
21896
|
+
if (opts.dtx === undefined) {
|
21901
21897
|
_this2.log.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.", Object.assign(Object.assign({}, _this2.logContext), getLogContextFromTrack(track)));
|
21902
21898
|
}
|
21903
|
-
if (
|
21899
|
+
if (opts.red === undefined) {
|
21904
21900
|
_this2.log.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work.");
|
21905
21901
|
}
|
21906
|
-
(_c =
|
21907
|
-
(_d =
|
21902
|
+
(_c = opts.dtx) !== null && _c !== void 0 ? _c : opts.dtx = false;
|
21903
|
+
(_d = opts.red) !== null && _d !== void 0 ? _d : opts.red = false;
|
21908
21904
|
}
|
21909
|
-
const opts = Object.assign(Object.assign({}, _this2.roomOptions.publishDefaults), options);
|
21910
21905
|
if (!isE2EESimulcastSupported() && _this2.roomOptions.e2ee) {
|
21911
21906
|
_this2.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2", Object.assign({}, _this2.logContext));
|
21912
21907
|
opts.simulcast = false;
|
@@ -24513,7 +24508,7 @@ class Room extends eventsExports.EventEmitter {
|
|
24513
24508
|
*/
|
24514
24509
|
simulateScenario(scenario, arg) {
|
24515
24510
|
return __awaiter(this, void 0, void 0, function* () {
|
24516
|
-
let postAction = () => {};
|
24511
|
+
let postAction = () => __awaiter(this, void 0, void 0, function* () {});
|
24517
24512
|
let req;
|
24518
24513
|
switch (scenario) {
|
24519
24514
|
case 'signal-reconnect':
|