@webex/web-client-media-engine 1.40.3 → 1.40.5

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/cjs/index.js CHANGED
@@ -481,6 +481,134 @@ var media = /*#__PURE__*/Object.freeze({
481
481
  ensureDevicePermissions: ensureDevicePermissions
482
482
  });
483
483
 
484
+ var ErrorTypes;
485
+ (function (ErrorTypes) {
486
+ ErrorTypes["DEVICE_PERMISSION_DENIED"] = "DEVICE_PERMISSION_DENIED";
487
+ ErrorTypes["CREATE_CAMERA_TRACK_FAILED"] = "CREATE_CAMERA_TRACK_FAILED";
488
+ ErrorTypes["CREATE_MICROPHONE_TRACK_FAILED"] = "CREATE_MICROPHONE_TRACK_FAILED";
489
+ })(ErrorTypes || (ErrorTypes = {}));
490
+ /**
491
+ * Represents a WCME error, which contains error type and error message.
492
+ */
493
+ class WcmeError {
494
+ /**
495
+ * Creates new error.
496
+ *
497
+ * @param type - Error type.
498
+ * @param message - Error message.
499
+ */
500
+ constructor(type, message = '') {
501
+ this.type = type;
502
+ this.message = message;
503
+ }
504
+ }
505
+ /**
506
+ * Creates a camera video track. Please note that the constraint params in second getUserMedia call would NOT take effect when:
507
+ *
508
+ * 1. Previous captured video track from the same device is not stopped .
509
+ * 2. Previous createCameraTrack() call for the same device is in progress.
510
+ *
511
+ * @param constructor - Constructor for the local camera track.
512
+ * @param constraints - Video device constraints.
513
+ * @returns A LocalTrack object or an error.
514
+ */
515
+ function createCameraTrack(constructor, constraints) {
516
+ return __awaiter$1(this, void 0, void 0, function* () {
517
+ let stream;
518
+ try {
519
+ stream = yield getUserMedia({ video: Object.assign({}, constraints) });
520
+ }
521
+ catch (error) {
522
+ throw new WcmeError(ErrorTypes.CREATE_CAMERA_TRACK_FAILED, `Failed to create camera track ${error}`);
523
+ }
524
+ return new constructor(stream);
525
+ });
526
+ }
527
+ /**
528
+ * Creates a microphone audio track.
529
+ *
530
+ * @param constructor - Constructor for the local microphone track.
531
+ * @param constraints - Audio device constraints.
532
+ * @returns A LocalTrack object or an error.
533
+ */
534
+ function createMicrophoneTrack(constructor, constraints) {
535
+ return __awaiter$1(this, void 0, void 0, function* () {
536
+ let stream;
537
+ try {
538
+ stream = yield getUserMedia({ audio: Object.assign({}, constraints) });
539
+ }
540
+ catch (error) {
541
+ throw new WcmeError(ErrorTypes.CREATE_MICROPHONE_TRACK_FAILED, `Failed to create microphone track ${error}`);
542
+ }
543
+ return new constructor(stream);
544
+ });
545
+ }
546
+ /**
547
+ * Creates a display video track.
548
+ *
549
+ * @param constructor - Constructor for the local display track.
550
+ * @param videoContentHint - An optional parameters to give a hint for the content of the track.
551
+ * @returns A Promise that resolves to a LocalDisplayTrack.
552
+ */
553
+ function createDisplayTrack(constructor, videoContentHint) {
554
+ return __awaiter$1(this, void 0, void 0, function* () {
555
+ const stream = yield getDisplayMedia({ video: true });
556
+ return new constructor(stream, videoContentHint);
557
+ });
558
+ }
559
+ /**
560
+ * Enumerates the media input and output devices available.
561
+ *
562
+ * @param deviceKind - Optional filter to return a specific device kind.
563
+ * @returns List of media devices in an array of MediaDeviceInfo objects.
564
+ */
565
+ function getDevices(deviceKind) {
566
+ return __awaiter$1(this, void 0, void 0, function* () {
567
+ let devices;
568
+ try {
569
+ devices = yield ensureDevicePermissions([DeviceKind.AudioInput, DeviceKind.VideoInput], enumerateDevices);
570
+ }
571
+ catch (error) {
572
+ throw new WcmeError(ErrorTypes.DEVICE_PERMISSION_DENIED, 'Failed to ensure device permissions');
573
+ }
574
+ return devices.filter((v) => (deviceKind ? v.kind === deviceKind : true));
575
+ });
576
+ }
577
+ /**
578
+ * Helper function to get a list of microphone devices.
579
+ *
580
+ * @returns List of microphone devices in an array of MediaDeviceInfo objects.
581
+ */
582
+ function getAudioInputDevices() {
583
+ return __awaiter$1(this, void 0, void 0, function* () {
584
+ return getDevices(DeviceKind.AudioInput);
585
+ });
586
+ }
587
+ /**
588
+ * Helper function to get a list of speaker devices.
589
+ *
590
+ * @returns List of speaker devices in an array of MediaDeviceInfo objects.
591
+ */
592
+ function getAudioOutputDevices() {
593
+ return __awaiter$1(this, void 0, void 0, function* () {
594
+ return getDevices(DeviceKind.AudioOutput);
595
+ });
596
+ }
597
+ /**
598
+ * Helper function to get a list of camera devices.
599
+ *
600
+ * @returns List of camera devices in an array of MediaDeviceInfo objects.
601
+ */
602
+ function getVideoInputDevices() {
603
+ return __awaiter$1(this, void 0, void 0, function* () {
604
+ return getDevices(DeviceKind.VideoInput);
605
+ });
606
+ }
607
+ /**
608
+ * Export the setOnDeviceChangeHandler method directly from the core lib.
609
+ */
610
+ const { setOnDeviceChangeHandler } = media;
611
+
484
612
  var events$1 = {exports: {}};
485
613
 
486
614
  var R$1 = typeof Reflect === 'object' ? Reflect : null;
@@ -1231,6 +1359,25 @@ class LocalCameraTrack extends LocalTrack {
1231
1359
  * Represents a local track for a display source.
1232
1360
  */
1233
1361
  class LocalDisplayTrack extends LocalTrack {
1362
+ /**
1363
+ * Create a LocalDisplayTrack from the given values.
1364
+ *
1365
+ * @param stream - The MediaStream for this track.
1366
+ * @param videoContentHint - An optional content hint, describing the content of the track.
1367
+ */
1368
+ constructor(stream, videoContentHint) {
1369
+ super(stream);
1370
+ this._videoContentHint = videoContentHint;
1371
+ this.underlyingTrack.contentHint = videoContentHint || '';
1372
+ }
1373
+ /**
1374
+ * Get the VideoContentHint for this track.
1375
+ *
1376
+ * @returns The VideoContentHint for this track.
1377
+ */
1378
+ get videoContentHint() {
1379
+ return this._videoContentHint;
1380
+ }
1234
1381
  }
1235
1382
 
1236
1383
  /**
@@ -1239,130 +1386,6 @@ class LocalDisplayTrack extends LocalTrack {
1239
1386
  class LocalMicrophoneTrack extends LocalTrack {
1240
1387
  }
1241
1388
 
1242
- var ErrorTypes;
1243
- (function (ErrorTypes) {
1244
- ErrorTypes["DEVICE_PERMISSION_DENIED"] = "DEVICE_PERMISSION_DENIED";
1245
- ErrorTypes["CREATE_CAMERA_TRACK_FAILED"] = "CREATE_CAMERA_TRACK_FAILED";
1246
- ErrorTypes["CREATE_MICROPHONE_TRACK_FAILED"] = "CREATE_MICROPHONE_TRACK_FAILED";
1247
- })(ErrorTypes || (ErrorTypes = {}));
1248
- /**
1249
- * Represents a WCME error, which contains error type and error message.
1250
- */
1251
- class WcmeError {
1252
- /**
1253
- * Creates new error.
1254
- *
1255
- * @param type - Error type.
1256
- * @param message - Error message.
1257
- */
1258
- constructor(type, message = '') {
1259
- this.type = type;
1260
- this.message = message;
1261
- }
1262
- }
1263
- /**
1264
- * Creates a camera video track. Please note that the constraint params in second getUserMedia call would NOT take effect when:
1265
- *
1266
- * 1. Previous captured video track from the same device is not stopped .
1267
- * 2. Previous createCameraTrack() call for the same device is in progress.
1268
- *
1269
- * @param constraints - Video device constraints.
1270
- * @returns A LocalTrack object or an error.
1271
- */
1272
- function createCameraTrack(constraints) {
1273
- return __awaiter$1(this, void 0, void 0, function* () {
1274
- let stream;
1275
- try {
1276
- stream = yield getUserMedia({ video: Object.assign({}, constraints) });
1277
- }
1278
- catch (error) {
1279
- throw new WcmeError(ErrorTypes.CREATE_CAMERA_TRACK_FAILED, `Failed to create camera track ${error}`);
1280
- }
1281
- return new LocalCameraTrack(stream);
1282
- });
1283
- }
1284
- /**
1285
- * Creates a microphone audio track.
1286
- *
1287
- * @param constraints - Audio device constraints.
1288
- * @returns A LocalTrack object or an error.
1289
- */
1290
- function createMicrophoneTrack(constraints) {
1291
- return __awaiter$1(this, void 0, void 0, function* () {
1292
- let stream;
1293
- try {
1294
- stream = yield getUserMedia({ audio: Object.assign({}, constraints) });
1295
- }
1296
- catch (error) {
1297
- throw new WcmeError(ErrorTypes.CREATE_MICROPHONE_TRACK_FAILED, `Failed to create microphone track ${error}`);
1298
- }
1299
- return new LocalMicrophoneTrack(stream);
1300
- });
1301
- }
1302
- /**
1303
- * Creates a display video track.
1304
- *
1305
- * @returns A Promise that resolves to a LocalDisplayTrack.
1306
- */
1307
- function createDisplayTrack() {
1308
- return __awaiter$1(this, void 0, void 0, function* () {
1309
- const stream = yield getDisplayMedia({ video: true });
1310
- return new LocalDisplayTrack(stream);
1311
- });
1312
- }
1313
- /**
1314
- * Enumerates the media input and output devices available.
1315
- *
1316
- * @param deviceKind - Optional filter to return a specific device kind.
1317
- * @returns List of media devices in an array of MediaDeviceInfo objects.
1318
- */
1319
- function getDevices(deviceKind) {
1320
- return __awaiter$1(this, void 0, void 0, function* () {
1321
- let devices;
1322
- try {
1323
- devices = yield ensureDevicePermissions([DeviceKind.AudioInput, DeviceKind.VideoInput], enumerateDevices);
1324
- }
1325
- catch (error) {
1326
- throw new WcmeError(ErrorTypes.DEVICE_PERMISSION_DENIED, 'Failed to ensure device permissions');
1327
- }
1328
- return devices.filter((v) => (deviceKind ? v.kind === deviceKind : true));
1329
- });
1330
- }
1331
- /**
1332
- * Helper function to get a list of microphone devices.
1333
- *
1334
- * @returns List of microphone devices in an array of MediaDeviceInfo objects.
1335
- */
1336
- function getAudioInputDevices() {
1337
- return __awaiter$1(this, void 0, void 0, function* () {
1338
- return getDevices(DeviceKind.AudioInput);
1339
- });
1340
- }
1341
- /**
1342
- * Helper function to get a list of speaker devices.
1343
- *
1344
- * @returns List of speaker devices in an array of MediaDeviceInfo objects.
1345
- */
1346
- function getAudioOutputDevices() {
1347
- return __awaiter$1(this, void 0, void 0, function* () {
1348
- return getDevices(DeviceKind.AudioOutput);
1349
- });
1350
- }
1351
- /**
1352
- * Helper function to get a list of camera devices.
1353
- *
1354
- * @returns List of camera devices in an array of MediaDeviceInfo objects.
1355
- */
1356
- function getVideoInputDevices() {
1357
- return __awaiter$1(this, void 0, void 0, function* () {
1358
- return getDevices(DeviceKind.VideoInput);
1359
- });
1360
- }
1361
- /**
1362
- * Export the setOnDeviceChangeHandler method directly from the core lib.
1363
- */
1364
- const { setOnDeviceChangeHandler } = media;
1365
-
1366
1389
  // Overall connection state (based on the ICE and DTLS connection states)
1367
1390
  exports.ConnectionState = void 0;
1368
1391
  (function (ConnectionState) {
@@ -5706,11 +5729,12 @@ function compareStreamIds(id1, id2) {
5706
5729
  }
5707
5730
 
5708
5731
  class SourceIndicationMsg {
5709
- constructor(seqNum, numTotalSources, numLiveSources, sources) {
5732
+ constructor(seqNum, numTotalSources, numLiveSources, sources, videoContentHint) {
5710
5733
  this.seqNum = seqNum;
5711
5734
  this.numTotalSources = numTotalSources;
5712
5735
  this.numLiveSources = numLiveSources;
5713
5736
  this.sources = sources;
5737
+ this.videoContentHint = videoContentHint;
5714
5738
  }
5715
5739
  sourcesToString() {
5716
5740
  return this.sources
@@ -5806,13 +5830,13 @@ class JmpSession extends events$2.EventEmitter {
5806
5830
  this.logger.warn(`Retransmits for message expired: ${expiredJmpMsg}`);
5807
5831
  });
5808
5832
  }
5809
- updateSourceIndication(numTotalSources, numLiveSources, sources) {
5833
+ updateSourceIndication(numTotalSources, numLiveSources, sources, videoContentHint) {
5810
5834
  var _a;
5811
5835
  const filteredSources = sources.filter((source) => {
5812
5836
  var _a;
5813
5837
  return (_a = this.lastReceivedScr) === null || _a === void 0 ? void 0 : _a.requests.some((req) => req.ids.find((streamId) => compareStreamIds(streamId, source.id)));
5814
5838
  });
5815
- const sourceIndicationMsg = new SourceIndicationMsg(this.currSourceIndicationSeqNum++, numTotalSources, numLiveSources, filteredSources);
5839
+ const sourceIndicationMsg = new SourceIndicationMsg(this.currSourceIndicationSeqNum++, numTotalSources, numLiveSources, filteredSources, videoContentHint);
5816
5840
  const jmpMsg = new JmpMsg(this.mediaFamily, this.mediaContent, {
5817
5841
  msgType: JmpMsgType.SourceIndication,
5818
5842
  payload: sourceIndicationMsg,
@@ -9198,23 +9222,58 @@ class SsrcEgressStreamSignaler {
9198
9222
  this.streamIds = [];
9199
9223
  }
9200
9224
  signalStreams(simulcastEnabled, rtxEnabled, mLine) {
9225
+ var _a;
9201
9226
  mLine.rids = [];
9202
9227
  mLine.simulcast = undefined;
9203
- mLine.ssrcs = [];
9204
- mLine.ssrcGroups = [];
9205
9228
  mLine.extMaps = mLine.extMaps.filter((extMapLine) => !/^urn:ietf:params:rtp-hdrext:sdes:(?:mid|rtp-stream-id|repaired-rtp-stream-id)$/.test(extMapLine.uri));
9206
- if (this.streamIds.length === 0) {
9207
- const numStreams = simulcastEnabled ? 3 : 1;
9208
- [...Array(numStreams).keys()].forEach(() => {
9209
- const newStreamId = {
9210
- ssrc: generateSsrc(),
9211
- };
9212
- if (rtxEnabled) {
9213
- newStreamId.rtxSsrc = generateSsrc();
9229
+ const numStreams = simulcastEnabled ? 3 : 1;
9230
+ if (!this.streamIds.length) {
9231
+ if (mLine.ssrcs.length) {
9232
+ const ssrcs = [...new Set(mLine.ssrcs.map((ssrcLine) => ssrcLine.ssrcId))];
9233
+ mLine.ssrcGroups.forEach((sg) => {
9234
+ if (!sg.ssrcs.every((ssrc) => ssrcs.includes(ssrc))) {
9235
+ throw new Error('SSRC present in SSRC groups is missing from SSRC lines');
9236
+ }
9237
+ });
9238
+ const rtxSsrcGroups = mLine.ssrcGroups.filter((sg) => sg.semantics === 'FID');
9239
+ if (rtxSsrcGroups.length && rtxSsrcGroups.length !== numStreams) {
9240
+ throw new Error(`Expect ${numStreams} RTX SSRC groups, got ${rtxSsrcGroups.length}`);
9214
9241
  }
9215
- this.streamIds.push(newStreamId);
9216
- });
9242
+ rtxSsrcGroups.forEach((sg) => {
9243
+ this.streamIds.push({
9244
+ ssrc: sg.ssrcs[0],
9245
+ rtxSsrc: sg.ssrcs[1],
9246
+ });
9247
+ });
9248
+ const simulcastSsrcs = (_a = mLine.ssrcGroups.find((sg) => sg.semantics === 'SIM')) === null || _a === void 0 ? void 0 : _a.ssrcs;
9249
+ if (simulcastSsrcs) {
9250
+ if (simulcastSsrcs.length !== numStreams ||
9251
+ !this.streamIds.every((streamId) => simulcastSsrcs.includes(streamId.ssrc))) {
9252
+ throw new Error('SSRCs in simulcast SSRC group do not match primary SSRCs in RTX SSRC groups');
9253
+ }
9254
+ this.streamIds.sort((a, b) => simulcastSsrcs.indexOf(a.ssrc) - simulcastSsrcs.indexOf(b.ssrc));
9255
+ }
9256
+ else if (rtxSsrcGroups.length > 1) {
9257
+ throw new Error('Multiple RTX SSRC groups but no simulcast SSRC group found');
9258
+ }
9259
+ if (!this.streamIds.length) {
9260
+ this.streamIds.push({ ssrc: ssrcs[0] });
9261
+ }
9262
+ }
9263
+ else {
9264
+ [...Array(numStreams).keys()].forEach(() => {
9265
+ const newStreamId = {
9266
+ ssrc: generateSsrc(),
9267
+ };
9268
+ if (rtxEnabled) {
9269
+ newStreamId.rtxSsrc = generateSsrc();
9270
+ }
9271
+ this.streamIds.push(newStreamId);
9272
+ });
9273
+ }
9217
9274
  }
9275
+ mLine.ssrcs = [];
9276
+ mLine.ssrcGroups = [];
9218
9277
  this.streamIds.forEach((streamId) => {
9219
9278
  const rtpSsrc = streamId.ssrc;
9220
9279
  mLine.addLine(new SsrcLine(rtpSsrc, 'cname', `${rtpSsrc}-cname`));
@@ -9682,6 +9741,15 @@ function toMediaStreamTrackKind(mediaType) {
9682
9741
  ? exports.MediaStreamTrackKind.Video
9683
9742
  : exports.MediaStreamTrackKind.Audio;
9684
9743
  }
9744
+ function webRtcVideoContentHintToJmpVideoContentHint(hint) {
9745
+ if (hint === 'motion') {
9746
+ return 'motion';
9747
+ }
9748
+ if (hint === 'detail') {
9749
+ return 'sharpness';
9750
+ }
9751
+ return undefined;
9752
+ }
9685
9753
  function toMediaFamily(kind) {
9686
9754
  if (kind === exports.MediaStreamTrackKind.Video) {
9687
9755
  return MediaFamily.Video;
@@ -9930,24 +9998,8 @@ class MultistreamConnection extends EventEmitter {
9930
9998
  const dataChannel = this.pc.createDataChannel('datachannel', {});
9931
9999
  dataChannel.onopen = (e) => {
9932
10000
  logger.info('DataChannel opened: ', e);
9933
- this.sendTransceivers.forEach((transceiver, mediaType) => {
9934
- const track = transceiver.publishedTrack;
9935
- if (track) {
9936
- if (getMediaFamily(mediaType) === MediaFamily.Audio) {
9937
- this.sendSourceIndication(mediaType, +!track.muted);
9938
- }
9939
- else {
9940
- const signaler = this.streamSignalerManager.getEgressStreamSignalerOrThrow(transceiver.mid);
9941
- const state = track.muted ? 'avatar' : 'live';
9942
- const sources = signaler
9943
- .getSenderIds()
9944
- .map((id) => ({ id, state, csi: transceiver.csi }));
9945
- this.sendSourceIndication(mediaType, +!track.muted, sources);
9946
- }
9947
- }
9948
- else {
9949
- this.sendSourceIndication(mediaType, 0);
9950
- }
10001
+ [...this.sendTransceivers.keys()].forEach((mediaType) => {
10002
+ this.maybeSendSourceIndication(mediaType);
9951
10003
  });
9952
10004
  logger.info(`Flushing pending JMP task queue`);
9953
10005
  this.pendingJmpTasks.forEach((t) => t());
@@ -9996,11 +10048,31 @@ class MultistreamConnection extends EventEmitter {
9996
10048
  });
9997
10049
  this.pc.close();
9998
10050
  }
9999
- sendSourceIndication(mediaType, numLiveSources, sources = []) {
10051
+ maybeSendSourceIndication(mediaType) {
10052
+ var _a;
10053
+ const transceiver = this.getSendTransceiverOrThrow(mediaType);
10054
+ const numLiveSources = ((_a = transceiver.publishedTrack) === null || _a === void 0 ? void 0 : _a.muted) === false ? 1 : 0;
10055
+ if (getMediaFamily(mediaType) === MediaFamily.Video) {
10056
+ const sources = this.getVideoSources(mediaType);
10057
+ if (sources === null) {
10058
+ return;
10059
+ }
10060
+ let webRtcVideoContentHint;
10061
+ if (transceiver.publishedTrack instanceof LocalDisplayTrack) {
10062
+ webRtcVideoContentHint = transceiver.publishedTrack.videoContentHint;
10063
+ }
10064
+ this.sendSourceIndication(mediaType, numLiveSources, sources, webRtcVideoContentHintToJmpVideoContentHint(webRtcVideoContentHint));
10065
+ }
10066
+ else {
10067
+ this.sendSourceIndication(mediaType, numLiveSources);
10068
+ }
10069
+ }
10070
+ sendSourceIndication(mediaType, numLiveSources, sources = [], videoContentHint = undefined) {
10000
10071
  var _a;
10001
10072
  const task = () => {
10002
10073
  var _a;
10003
- (_a = this.jmpSessions.get(mediaType)) === null || _a === void 0 ? void 0 : _a.updateSourceIndication(1, numLiveSources, sources);
10074
+ (_a = this.jmpSessions
10075
+ .get(mediaType)) === null || _a === void 0 ? void 0 : _a.updateSourceIndication(1, numLiveSources, sources, videoContentHint);
10004
10076
  };
10005
10077
  if (((_a = this.dataChannel) === null || _a === void 0 ? void 0 : _a.readyState) === 'open') {
10006
10078
  task();
@@ -10045,24 +10117,9 @@ class MultistreamConnection extends EventEmitter {
10045
10117
  });
10046
10118
  }
10047
10119
  addTrackListeners(mediaType, track) {
10048
- const onTrackResolutionChange = () => {
10049
- const sources = this.getVideoSources(mediaType);
10050
- if (sources != null) {
10051
- this.sendSourceIndication(mediaType, 1, sources);
10052
- }
10053
- };
10120
+ const onTrackResolutionChange = () => this.maybeSendSourceIndication(mediaType);
10054
10121
  track.on(LocalTrack.Events.TrackConstraintsChange, onTrackResolutionChange);
10055
- const onTrackMute = (event) => {
10056
- if (getMediaFamily(mediaType) === MediaFamily.Audio) {
10057
- this.sendSourceIndication(mediaType, +!event.trackState.muted);
10058
- }
10059
- else {
10060
- const sources = this.getVideoSources(mediaType);
10061
- if (sources != null) {
10062
- this.sendSourceIndication(mediaType, +!event.trackState.muted, sources);
10063
- }
10064
- }
10065
- };
10122
+ const onTrackMute = () => this.maybeSendSourceIndication(mediaType);
10066
10123
  track.on(LocalTrack.Events.Muted, onTrackMute);
10067
10124
  const onTrackPublish = (event) => {
10068
10125
  if (!event.isPublished) {
@@ -10070,14 +10127,8 @@ class MultistreamConnection extends EventEmitter {
10070
10127
  track.off(LocalTrack.Events.PublishedStateUpdate, onTrackPublish);
10071
10128
  track.off(LocalTrack.Events.TrackConstraintsChange, onTrackResolutionChange);
10072
10129
  }
10073
- if (getMediaFamily(mediaType) === MediaFamily.Audio) {
10074
- this.sendSourceIndication(mediaType, +event.isPublished);
10075
- }
10076
- else {
10077
- const sources = this.getVideoSources(mediaType);
10078
- if (sources != null) {
10079
- this.sendSourceIndication(mediaType, +event.isPublished, sources);
10080
- }
10130
+ if (!track.muted) {
10131
+ this.maybeSendSourceIndication(mediaType);
10081
10132
  }
10082
10133
  };
10083
10134
  track.on(LocalTrack.Events.PublishedStateUpdate, onTrackPublish);
@@ -10369,7 +10420,7 @@ class MultistreamConnection extends EventEmitter {
10369
10420
  }
10370
10421
  renewPeerConnection(userOptions) {
10371
10422
  if (userOptions) {
10372
- this.options = Object.assign(Object.assign({}, defaultMultistreamConnectionOptions), userOptions);
10423
+ this.options = Object.assign(Object.assign({}, this.options), userOptions);
10373
10424
  }
10374
10425
  logger.info(`Renewing multistream connection with options ${JSON.stringify(this.options)}`);
10375
10426
  this.clearMids();