@webex/web-client-media-engine 3.11.4 → 3.11.6

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/esm/index.js CHANGED
@@ -1486,6 +1486,36 @@ class _LocalStream extends Stream {
1486
1486
  getEffects() {
1487
1487
  return this.effects;
1488
1488
  }
1489
+ /**
1490
+ * Method to serialize data about input, output streams
1491
+ * and also effects from LocalStream.
1492
+ *
1493
+ * @returns - A JSON-compatible object representation with data from LocalStream.
1494
+ */
1495
+ toJSON() {
1496
+ return {
1497
+ muted: this.muted,
1498
+ label: this.label,
1499
+ readyState: this.readyState,
1500
+ inputStream: {
1501
+ active: this.inputStream.active,
1502
+ id: this.inputStream.id,
1503
+ enabled: this.inputTrack.enabled,
1504
+ muted: this.inputTrack.muted,
1505
+ },
1506
+ outputStream: {
1507
+ active: this.outputStream.active,
1508
+ id: this.outputStream.id,
1509
+ },
1510
+ effects: this.effects.map((effect) => {
1511
+ return {
1512
+ id: effect.id,
1513
+ kind: effect.kind,
1514
+ isEnabled: effect.isEnabled,
1515
+ };
1516
+ }),
1517
+ };
1518
+ }
1489
1519
  /**
1490
1520
  * Cleanup the local effects.
1491
1521
  */
@@ -14476,10 +14506,11 @@ class MultistreamConnection extends EventEmitter$2 {
14476
14506
  });
14477
14507
  jmpSession.on(JmpSessionEvents.MediaRequestReceived, (data) => {
14478
14508
  logger.log(`MediaRequest received: ${JSON.stringify(data)}`);
14479
- if (getMediaFamily(mediaType) === MediaFamily.Video) {
14480
- this.sendMediaRequestStatus(mediaType);
14481
- }
14482
- this.updateRequestedStreams(mediaType, data.requests);
14509
+ this.updateRequestedStreams(mediaType, data.requests).then(() => {
14510
+ if (getMediaFamily(mediaType) === MediaFamily.Video) {
14511
+ this.sendMediaRequestStatus(mediaType);
14512
+ }
14513
+ });
14483
14514
  });
14484
14515
  jmpSession.on(JmpSessionEvents.ActiveSpeaker, (data) => {
14485
14516
  this.emit(MultistreamConnectionEventNames.ActiveSpeakerNotification, data.csis);
@@ -14528,7 +14559,7 @@ class MultistreamConnection extends EventEmitter$2 {
14528
14559
  logger.warn(`${mediaType}: Unable to find matching stream ID for requested ID: ${JSON.stringify(id)}`);
14529
14560
  }
14530
14561
  });
14531
- sendTransceiver.updateSendParameters(requestedIdEncodingParamsMap);
14562
+ return sendTransceiver.updateSendParameters(requestedIdEncodingParamsMap);
14532
14563
  }
14533
14564
  createDataChannel() {
14534
14565
  const dataChannel = this.pc.createDataChannel('datachannel', {
@@ -14592,6 +14623,9 @@ class MultistreamConnection extends EventEmitter$2 {
14592
14623
  if (getMediaFamily(mediaType) !== MediaFamily.Video) {
14593
14624
  return;
14594
14625
  }
14626
+ if (!this.getSendTransceiverOrThrow(mediaType).requested) {
14627
+ return;
14628
+ }
14595
14629
  const streamStates = this.getVideoStreamStates(mediaType);
14596
14630
  const task = () => {
14597
14631
  var _a;