@webex/web-client-media-engine 3.11.8 → 3.12.0

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
@@ -5708,6 +5708,10 @@ var PeerConnectionEvents;
5708
5708
  (function (PeerConnectionEvents) {
5709
5709
  PeerConnectionEvents["IceGatheringStateChange"] = "icegatheringstatechange";
5710
5710
  PeerConnectionEvents["ConnectionStateChange"] = "connectionstatechange";
5711
+ PeerConnectionEvents["CreateOfferOnSuccess"] = "createofferonsuccess";
5712
+ PeerConnectionEvents["CreateAnswerOnSuccess"] = "createansweronsuccess";
5713
+ PeerConnectionEvents["SetLocalDescriptionOnSuccess"] = "setlocaldescriptiononsuccess";
5714
+ PeerConnectionEvents["SetRemoteDescriptionOnSuccess"] = "setremotedescriptiononsuccess";
5711
5715
  })(PeerConnectionEvents || (PeerConnectionEvents = {}));
5712
5716
  /**
5713
5717
  * Manages a single RTCPeerConnection with the server.
@@ -5821,7 +5825,10 @@ class PeerConnection extends EventEmitter$4 {
5821
5825
  */
5822
5826
  createAnswer(options) {
5823
5827
  return __awaiter$2(this, void 0, void 0, function* () {
5824
- return this.pc.createAnswer(options);
5828
+ return this.pc.createAnswer(options).then((answer) => {
5829
+ this.emit(PeerConnection.Events.CreateAnswerOnSuccess, answer);
5830
+ return answer;
5831
+ });
5825
5832
  });
5826
5833
  }
5827
5834
  /**
@@ -5836,7 +5843,10 @@ class PeerConnection extends EventEmitter$4 {
5836
5843
  */
5837
5844
  createOffer(options) {
5838
5845
  return __awaiter$2(this, void 0, void 0, function* () {
5839
- return this.pc.createOffer(options);
5846
+ return this.pc.createOffer(options).then((offer) => {
5847
+ this.emit(PeerConnection.Events.CreateOfferOnSuccess, offer);
5848
+ return offer;
5849
+ });
5840
5850
  });
5841
5851
  }
5842
5852
  /**
@@ -5861,7 +5871,11 @@ class PeerConnection extends EventEmitter$4 {
5861
5871
  }
5862
5872
  });
5863
5873
  }
5864
- return this.pc.setLocalDescription(description);
5874
+ return this.pc.setLocalDescription(description).then(() => {
5875
+ if (description) {
5876
+ this.emit(PeerConnection.Events.SetLocalDescriptionOnSuccess, description);
5877
+ }
5878
+ });
5865
5879
  });
5866
5880
  }
5867
5881
  /**
@@ -5875,7 +5889,9 @@ class PeerConnection extends EventEmitter$4 {
5875
5889
  */
5876
5890
  setRemoteDescription(description) {
5877
5891
  return __awaiter$2(this, void 0, void 0, function* () {
5878
- return this.pc.setRemoteDescription(description);
5892
+ return this.pc.setRemoteDescription(description).then(() => {
5893
+ this.emit(PeerConnection.Events.SetRemoteDescriptionOnSuccess, description);
5894
+ });
5879
5895
  });
5880
5896
  }
5881
5897
  /**
@@ -9484,11 +9500,10 @@ function injectJmpAttributes(mediaDescription, csi, streamSignalingMode) {
9484
9500
  }
9485
9501
  }
9486
9502
  function injectDummyCandidates(mediaDescription) {
9487
- if (mediaDescription.iceInfo.candidates.length === 0) {
9488
- mediaDescription.addLine(new CandidateLine('dummy1', 1, 'udp', 3, '0.0.0.0', 9, 'host'));
9489
- mediaDescription.addLine(new CandidateLine('dummy2', 1, 'tcp', 2, '0.0.0.0', 9, 'host'));
9490
- mediaDescription.addLine(new CandidateLine('dummy3', 1, 'udp', 1, '0.0.0.0', 9, 'relay'));
9491
- }
9503
+ mediaDescription.iceInfo.candidates = [];
9504
+ mediaDescription.addLine(new CandidateLine('dummy1', 1, 'udp', 3, '0.0.0.0', 9, 'host'));
9505
+ mediaDescription.addLine(new CandidateLine('dummy2', 1, 'tcp', 2, '0.0.0.0', 9, 'host'));
9506
+ mediaDescription.addLine(new CandidateLine('dummy3', 1, 'udp', 1, '0.0.0.0', 9, 'relay'));
9492
9507
  }
9493
9508
  function removeMidRidExtensions(mediaDescription) {
9494
9509
  mediaDescription.extMaps.forEach((extMapLine, extId, extMap) => {
@@ -14390,6 +14405,10 @@ var MultistreamConnectionEventNames;
14390
14405
  MultistreamConnectionEventNames["ActiveSpeakerNotification"] = "active-speaker-notification";
14391
14406
  MultistreamConnectionEventNames["ConnectionStateUpdate"] = "connection-state-update";
14392
14407
  MultistreamConnectionEventNames["NegotiationNeeded"] = "negotiation-needed";
14408
+ MultistreamConnectionEventNames["CreateOfferOnSuccess"] = "createofferonsuccess";
14409
+ MultistreamConnectionEventNames["CreateAnswerOnSuccess"] = "createansweronsuccess";
14410
+ MultistreamConnectionEventNames["SetLocalDescriptionOnSuccess"] = "setlocaldescriptiononsuccess";
14411
+ MultistreamConnectionEventNames["SetRemoteDescriptionOnSuccess"] = "setremotedescriptiononsuccess";
14393
14412
  })(MultistreamConnectionEventNames || (MultistreamConnectionEventNames = {}));
14394
14413
  const defaultMultistreamConnectionOptions = {
14395
14414
  disableSimulcast: BrowserInfo.isFirefox(),
@@ -14432,10 +14451,27 @@ class MultistreamConnection extends EventEmitter$2 {
14432
14451
  iceServers: this.options.iceServers,
14433
14452
  bundlePolicy: this.options.bundlePolicy,
14434
14453
  });
14435
- this.pc.on(PeerConnection.Events.ConnectionStateChange, (state) => this.emit(MultistreamConnectionEventNames.ConnectionStateUpdate, state));
14454
+ this.propagatePeerConnectionEvents();
14436
14455
  this.attachMetricsObserver();
14437
14456
  this.createDataChannel();
14438
14457
  }
14458
+ propagatePeerConnectionEvents() {
14459
+ this.pc.on(PeerConnection.Events.ConnectionStateChange, (state) => {
14460
+ this.emit(MultistreamConnectionEventNames.ConnectionStateUpdate, state);
14461
+ });
14462
+ this.pc.on(PeerConnection.Events.CreateOfferOnSuccess, (description) => {
14463
+ this.emit(MultistreamConnectionEventNames.CreateOfferOnSuccess, description);
14464
+ });
14465
+ this.pc.on(PeerConnection.Events.CreateAnswerOnSuccess, (description) => {
14466
+ this.emit(MultistreamConnectionEventNames.CreateAnswerOnSuccess, description);
14467
+ });
14468
+ this.pc.on(PeerConnection.Events.SetLocalDescriptionOnSuccess, (description) => {
14469
+ this.emit(MultistreamConnectionEventNames.SetLocalDescriptionOnSuccess, description);
14470
+ });
14471
+ this.pc.on(PeerConnection.Events.SetRemoteDescriptionOnSuccess, (description) => {
14472
+ this.emit(MultistreamConnectionEventNames.SetRemoteDescriptionOnSuccess, description);
14473
+ });
14474
+ }
14439
14475
  getConnectionState() {
14440
14476
  return this.pc.getConnectionState();
14441
14477
  }