@webex/web-client-media-engine 3.39.12 → 3.40.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/cjs/index.js CHANGED
@@ -6521,6 +6521,14 @@ class PeerConnection extends EventEmitter$4 {
6521
6521
  getIceCandidates() {
6522
6522
  return this.iceCandidates;
6523
6523
  }
6524
+ /**
6525
+ * Sets the current configuration of the underlying RTCPeerConnection.
6526
+ *
6527
+ * @param configuration - An RTCConfiguration object which provides the options to be set.
6528
+ */
6529
+ setConfiguration(configuration) {
6530
+ this.pc.setConfiguration(configuration);
6531
+ }
6524
6532
  /**
6525
6533
  * Adds a new media track to the set of tracks which will be transmitted to the other peer.
6526
6534
  *
@@ -15920,21 +15928,12 @@ exports.MultistreamConnectionEventNames = void 0;
15920
15928
  MultistreamConnectionEventNames["IceCandidate"] = "icecandidate";
15921
15929
  MultistreamConnectionEventNames["IceCandidateError"] = "icecandidateerror";
15922
15930
  })(exports.MultistreamConnectionEventNames || (exports.MultistreamConnectionEventNames = {}));
15923
- const defaultMultistreamConnectionOptions = {
15924
- disableSimulcast: BrowserInfo.isFirefox(),
15925
- bundlePolicy: 'max-compat',
15931
+ const defaultPeerConnectionConfiguration = {
15932
+ bundlePolicy: 'max-bundle',
15926
15933
  iceServers: undefined,
15927
15934
  iceTransportPolicy: 'all',
15928
- disableContentSimulcast: true,
15929
- disableAudioTwcc: true,
15930
- doFullIce: BrowserInfo.isFirefox(),
15931
- stopIceGatheringAfterFirstRelayCandidate: false,
15932
- disableAudioMainDtx: true,
15933
- preferredStartingBitrateKbps: defaultStartBitrateKbps,
15934
- metricsCallback: () => { },
15935
- enableInboundAudioLevelMonitoring: false,
15936
- enableAV1SlidesSupport: false,
15937
15935
  };
15936
+ const defaultMultistreamConnectionOptions = Object.assign(Object.assign({}, defaultPeerConnectionConfiguration), { disableSimulcast: BrowserInfo.isFirefox(), disableContentSimulcast: true, disableAudioTwcc: true, doFullIce: BrowserInfo.isFirefox(), stopIceGatheringAfterFirstRelayCandidate: false, disableAudioMainDtx: true, preferredStartingBitrateKbps: defaultStartBitrateKbps, metricsCallback: () => { }, enableInboundAudioLevelMonitoring: false, enableAV1SlidesSupport: false });
15938
15937
  let staticIdCounter = 0;
15939
15938
  class MultistreamConnection extends EventEmitter$2 {
15940
15939
  constructor(userOptions = {}) {
@@ -15970,6 +15969,10 @@ class MultistreamConnection extends EventEmitter$2 {
15970
15969
  this.createSendTransceiver(exports.MediaType.VideoSlides, slidesSceneId, supportedVideoSlidesCodecs, videoSlidesEncodingOptions, sendVideoCodecParams);
15971
15970
  this.createSendTransceiver(exports.MediaType.AudioSlides, slidesSceneId, supportedAudioCodecs);
15972
15971
  }
15972
+ setConfiguration(configuration) {
15973
+ Object.assign(this.options, configuration);
15974
+ this.pc.setConfiguration(this.getPeerConnectionConfiguration());
15975
+ }
15973
15976
  startWorkerIfNeeded() {
15974
15977
  if (this.options.enableInboundAudioLevelMonitoring) {
15975
15978
  if (WebCapabilities.supportsEncodedStreamTransforms() !== CapabilityState.CAPABLE) {
@@ -15979,12 +15982,12 @@ class MultistreamConnection extends EventEmitter$2 {
15979
15982
  getWorkerManager().startWorker();
15980
15983
  }
15981
15984
  }
15985
+ getPeerConnectionConfiguration() {
15986
+ const { bundlePolicy, iceServers, iceTransportPolicy } = this.options;
15987
+ return { bundlePolicy, iceServers, iceTransportPolicy };
15988
+ }
15982
15989
  initializePeerConnection() {
15983
- this.pc = new PeerConnection({
15984
- iceServers: this.options.iceServers,
15985
- bundlePolicy: this.options.bundlePolicy,
15986
- iceTransportPolicy: this.options.iceTransportPolicy,
15987
- });
15990
+ this.pc = new PeerConnection(this.getPeerConnectionConfiguration());
15988
15991
  this.propagatePeerConnectionEvents();
15989
15992
  this.attachMetricsObserver();
15990
15993
  this.createDataChannel();
@@ -16541,7 +16544,7 @@ SCTP Max Message Size: ${maxMessageSize}`);
16541
16544
  });
16542
16545
  });
16543
16546
  }
16544
- createOffer() {
16547
+ createOffer(options = {}) {
16545
16548
  return __awaiter(this, void 0, void 0, function* () {
16546
16549
  if (!this.pc.getLocalDescription()) {
16547
16550
  this.midPredictor.allocateMidForDatachannel();
@@ -16556,7 +16559,7 @@ SCTP Max Message Size: ${maxMessageSize}`);
16556
16559
  this.offerAnswerQueue.push(() => __awaiter(this, void 0, void 0, function* () {
16557
16560
  var _a;
16558
16561
  try {
16559
- const offer = yield this.pc.createOffer();
16562
+ const offer = yield this.pc.createOffer(options);
16560
16563
  if (!offer.sdp) {
16561
16564
  logErrorAndThrow(exports.WcmeErrorType.CREATE_OFFER_FAILED, 'SDP not found in offer.');
16562
16565
  }