@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 +22 -19
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +22 -19
- package/dist/esm/index.js.map +1 -1
- package/dist/types/index.d.ts +9 -4
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -6517,6 +6517,14 @@ class PeerConnection extends EventEmitter$4 {
|
|
|
6517
6517
|
getIceCandidates() {
|
|
6518
6518
|
return this.iceCandidates;
|
|
6519
6519
|
}
|
|
6520
|
+
/**
|
|
6521
|
+
* Sets the current configuration of the underlying RTCPeerConnection.
|
|
6522
|
+
*
|
|
6523
|
+
* @param configuration - An RTCConfiguration object which provides the options to be set.
|
|
6524
|
+
*/
|
|
6525
|
+
setConfiguration(configuration) {
|
|
6526
|
+
this.pc.setConfiguration(configuration);
|
|
6527
|
+
}
|
|
6520
6528
|
/**
|
|
6521
6529
|
* Adds a new media track to the set of tracks which will be transmitted to the other peer.
|
|
6522
6530
|
*
|
|
@@ -15916,21 +15924,12 @@ var MultistreamConnectionEventNames;
|
|
|
15916
15924
|
MultistreamConnectionEventNames["IceCandidate"] = "icecandidate";
|
|
15917
15925
|
MultistreamConnectionEventNames["IceCandidateError"] = "icecandidateerror";
|
|
15918
15926
|
})(MultistreamConnectionEventNames || (MultistreamConnectionEventNames = {}));
|
|
15919
|
-
const
|
|
15920
|
-
|
|
15921
|
-
bundlePolicy: 'max-compat',
|
|
15927
|
+
const defaultPeerConnectionConfiguration = {
|
|
15928
|
+
bundlePolicy: 'max-bundle',
|
|
15922
15929
|
iceServers: undefined,
|
|
15923
15930
|
iceTransportPolicy: 'all',
|
|
15924
|
-
disableContentSimulcast: true,
|
|
15925
|
-
disableAudioTwcc: true,
|
|
15926
|
-
doFullIce: BrowserInfo.isFirefox(),
|
|
15927
|
-
stopIceGatheringAfterFirstRelayCandidate: false,
|
|
15928
|
-
disableAudioMainDtx: true,
|
|
15929
|
-
preferredStartingBitrateKbps: defaultStartBitrateKbps,
|
|
15930
|
-
metricsCallback: () => { },
|
|
15931
|
-
enableInboundAudioLevelMonitoring: false,
|
|
15932
|
-
enableAV1SlidesSupport: false,
|
|
15933
15931
|
};
|
|
15932
|
+
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 });
|
|
15934
15933
|
let staticIdCounter = 0;
|
|
15935
15934
|
class MultistreamConnection extends EventEmitter$2 {
|
|
15936
15935
|
constructor(userOptions = {}) {
|
|
@@ -15966,6 +15965,10 @@ class MultistreamConnection extends EventEmitter$2 {
|
|
|
15966
15965
|
this.createSendTransceiver(MediaType.VideoSlides, slidesSceneId, supportedVideoSlidesCodecs, videoSlidesEncodingOptions, sendVideoCodecParams);
|
|
15967
15966
|
this.createSendTransceiver(MediaType.AudioSlides, slidesSceneId, supportedAudioCodecs);
|
|
15968
15967
|
}
|
|
15968
|
+
setConfiguration(configuration) {
|
|
15969
|
+
Object.assign(this.options, configuration);
|
|
15970
|
+
this.pc.setConfiguration(this.getPeerConnectionConfiguration());
|
|
15971
|
+
}
|
|
15969
15972
|
startWorkerIfNeeded() {
|
|
15970
15973
|
if (this.options.enableInboundAudioLevelMonitoring) {
|
|
15971
15974
|
if (WebCapabilities.supportsEncodedStreamTransforms() !== CapabilityState.CAPABLE) {
|
|
@@ -15975,12 +15978,12 @@ class MultistreamConnection extends EventEmitter$2 {
|
|
|
15975
15978
|
getWorkerManager().startWorker();
|
|
15976
15979
|
}
|
|
15977
15980
|
}
|
|
15981
|
+
getPeerConnectionConfiguration() {
|
|
15982
|
+
const { bundlePolicy, iceServers, iceTransportPolicy } = this.options;
|
|
15983
|
+
return { bundlePolicy, iceServers, iceTransportPolicy };
|
|
15984
|
+
}
|
|
15978
15985
|
initializePeerConnection() {
|
|
15979
|
-
this.pc = new PeerConnection(
|
|
15980
|
-
iceServers: this.options.iceServers,
|
|
15981
|
-
bundlePolicy: this.options.bundlePolicy,
|
|
15982
|
-
iceTransportPolicy: this.options.iceTransportPolicy,
|
|
15983
|
-
});
|
|
15986
|
+
this.pc = new PeerConnection(this.getPeerConnectionConfiguration());
|
|
15984
15987
|
this.propagatePeerConnectionEvents();
|
|
15985
15988
|
this.attachMetricsObserver();
|
|
15986
15989
|
this.createDataChannel();
|
|
@@ -16537,7 +16540,7 @@ SCTP Max Message Size: ${maxMessageSize}`);
|
|
|
16537
16540
|
});
|
|
16538
16541
|
});
|
|
16539
16542
|
}
|
|
16540
|
-
createOffer() {
|
|
16543
|
+
createOffer(options = {}) {
|
|
16541
16544
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16542
16545
|
if (!this.pc.getLocalDescription()) {
|
|
16543
16546
|
this.midPredictor.allocateMidForDatachannel();
|
|
@@ -16552,7 +16555,7 @@ SCTP Max Message Size: ${maxMessageSize}`);
|
|
|
16552
16555
|
this.offerAnswerQueue.push(() => __awaiter(this, void 0, void 0, function* () {
|
|
16553
16556
|
var _a;
|
|
16554
16557
|
try {
|
|
16555
|
-
const offer = yield this.pc.createOffer();
|
|
16558
|
+
const offer = yield this.pc.createOffer(options);
|
|
16556
16559
|
if (!offer.sdp) {
|
|
16557
16560
|
logErrorAndThrow(WcmeErrorType.CREATE_OFFER_FAILED, 'SDP not found in offer.');
|
|
16558
16561
|
}
|