@webex/web-client-media-engine 3.22.0 → 3.22.2
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 +40 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +40 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/types/index.d.ts +9 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -9751,9 +9751,10 @@ function generateSsrc() {
|
|
|
9751
9751
|
}
|
|
9752
9752
|
|
|
9753
9753
|
class EgressSdpMunger {
|
|
9754
|
-
constructor() {
|
|
9754
|
+
constructor(options) {
|
|
9755
9755
|
this.streamIds = [];
|
|
9756
9756
|
this.customCodecParameters = new Map();
|
|
9757
|
+
this.egressMungerOptions = options;
|
|
9757
9758
|
}
|
|
9758
9759
|
reset() {
|
|
9759
9760
|
this.streamIds = [];
|
|
@@ -9842,7 +9843,9 @@ class EgressSdpMunger {
|
|
|
9842
9843
|
mungeLocalDescriptionForRemoteServer(mediaDescription, mediaContent, csi) {
|
|
9843
9844
|
injectContentType(mediaDescription, mediaContent);
|
|
9844
9845
|
injectJmpAttributes(mediaDescription, csi, 'SSRC');
|
|
9845
|
-
|
|
9846
|
+
if (!this.egressMungerOptions.doFullIce) {
|
|
9847
|
+
injectDummyCandidates(mediaDescription);
|
|
9848
|
+
}
|
|
9846
9849
|
if (mediaDescription.type === 'video') {
|
|
9847
9850
|
const ssrcGroup = mediaDescription.ssrcGroups.find((sg) => sg.semantics === 'SIM');
|
|
9848
9851
|
if (ssrcGroup) {
|
|
@@ -10480,7 +10483,7 @@ class ReceiveSlot extends EventEmitter$2 {
|
|
|
10480
10483
|
this.handleStreamMediaStateChange = this.handleStreamMediaStateChange.bind(this);
|
|
10481
10484
|
this.handleStreamEnded = this.handleStreamEnded.bind(this);
|
|
10482
10485
|
this._stream = new RemoteStream(new MediaStream([track]));
|
|
10483
|
-
this._sourceState = 'no source';
|
|
10486
|
+
this._sourceState = track.kind === exports.MediaStreamTrackKind.Video ? 'no source' : undefined;
|
|
10484
10487
|
this._stream.on(exports.RemoteStreamEventNames.MediaStateChange, this.handleStreamMediaStateChange);
|
|
10485
10488
|
this._stream.on(exports.StreamEventNames.Ended, this.handleStreamEnded);
|
|
10486
10489
|
}
|
|
@@ -10518,6 +10521,9 @@ class ReceiveSlot extends EventEmitter$2 {
|
|
|
10518
10521
|
get currentRxCsi() {
|
|
10519
10522
|
return this._currentRxCsi;
|
|
10520
10523
|
}
|
|
10524
|
+
get sourceState() {
|
|
10525
|
+
return this._sourceState;
|
|
10526
|
+
}
|
|
10521
10527
|
}
|
|
10522
10528
|
ReceiveSlot.Events = exports.ReceiveSlotEvents;
|
|
10523
10529
|
|
|
@@ -10591,6 +10597,7 @@ class ReceiveOnlyTransceiver extends Transceiver {
|
|
|
10591
10597
|
if (stats.type === 'inbound-rtp') {
|
|
10592
10598
|
stats.mid = this.mid;
|
|
10593
10599
|
stats.csi = this.receiveSlot.currentRxCsi;
|
|
10600
|
+
stats.sourceState = this.receiveSlot.sourceState;
|
|
10594
10601
|
stats.calliopeMediaType = this.metadata.mediaType;
|
|
10595
10602
|
stats.requestedBitrate = this.metadata.requestedBitrate;
|
|
10596
10603
|
stats.requestedFrameSize = this.metadata.requestedFrameSize;
|
|
@@ -14753,6 +14760,7 @@ const defaultMultistreamConnectionOptions = {
|
|
|
14753
14760
|
iceServers: undefined,
|
|
14754
14761
|
disableContentSimulcast: true,
|
|
14755
14762
|
disableAudioTwcc: true,
|
|
14763
|
+
doFullIce: BrowserInfo.isFirefox(),
|
|
14756
14764
|
};
|
|
14757
14765
|
class MultistreamConnection extends EventEmitter$2 {
|
|
14758
14766
|
constructor(userOptions = {}) {
|
|
@@ -14859,7 +14867,9 @@ class MultistreamConnection extends EventEmitter$2 {
|
|
|
14859
14867
|
}
|
|
14860
14868
|
const mid = this.midPredictor.getNextMid(mediaType);
|
|
14861
14869
|
const csi = generateCsi(getMediaFamily(mediaType), sceneId);
|
|
14862
|
-
const munger = new EgressSdpMunger(
|
|
14870
|
+
const munger = new EgressSdpMunger({
|
|
14871
|
+
doFullIce: this.options.doFullIce,
|
|
14872
|
+
});
|
|
14863
14873
|
const transceiver = new SendOnlyTransceiver(rtcTransceiver, mid, csi, munger, mediaType);
|
|
14864
14874
|
if (getMediaFamily(mediaType) === exports.MediaFamily.Video) {
|
|
14865
14875
|
transceiver.rtxEnabled = true;
|
|
@@ -15217,6 +15227,22 @@ SCTP Max Message Size: ${maxMessageSize}`);
|
|
|
15217
15227
|
}
|
|
15218
15228
|
return targetCodec.pt;
|
|
15219
15229
|
}
|
|
15230
|
+
waitForIceGatheringComplete() {
|
|
15231
|
+
return __awaiter$1(this, void 0, void 0, function* () {
|
|
15232
|
+
return new Promise((resolve) => {
|
|
15233
|
+
if (this.pc.iceGatheringState === 'complete') {
|
|
15234
|
+
resolve();
|
|
15235
|
+
}
|
|
15236
|
+
else {
|
|
15237
|
+
this.pc.on(PeerConnection.Events.IceGatheringStateChange, () => {
|
|
15238
|
+
if (this.pc.iceGatheringState === 'complete') {
|
|
15239
|
+
resolve();
|
|
15240
|
+
}
|
|
15241
|
+
});
|
|
15242
|
+
}
|
|
15243
|
+
});
|
|
15244
|
+
});
|
|
15245
|
+
}
|
|
15220
15246
|
createOffer() {
|
|
15221
15247
|
return __awaiter$1(this, void 0, void 0, function* () {
|
|
15222
15248
|
if (!this.pc.getLocalDescription()) {
|
|
@@ -15246,6 +15272,9 @@ SCTP Max Message Size: ${maxMessageSize}`);
|
|
|
15246
15272
|
var _a;
|
|
15247
15273
|
logErrorAndThrow(exports.WcmeErrorType.CREATE_OFFER_FAILED, `Error: ${error}. SDP: ${maskIp((_a = offer.sdp) !== null && _a !== void 0 ? _a : '')}`);
|
|
15248
15274
|
});
|
|
15275
|
+
if (this.options.doFullIce) {
|
|
15276
|
+
yield this.waitForIceGatheringComplete();
|
|
15277
|
+
}
|
|
15249
15278
|
const sdpToSend = this.prepareLocalOfferForRemoteServer((_a = this.pc.getLocalDescription()) === null || _a === void 0 ? void 0 : _a.sdp);
|
|
15250
15279
|
createOfferResolve({ type: 'offer', sdp: sdpToSend });
|
|
15251
15280
|
if (this.currentCreateOfferId > createOfferId) {
|
|
@@ -15350,11 +15379,13 @@ SCTP Max Message Size: ${maxMessageSize}`);
|
|
|
15350
15379
|
const sendTransceiver = this.getSendTransceiverByMidOrThrow(av.mid);
|
|
15351
15380
|
sendTransceiver.mungeLocalDescriptionForRemoteServer(av);
|
|
15352
15381
|
});
|
|
15353
|
-
|
|
15354
|
-
.
|
|
15355
|
-
|
|
15356
|
-
|
|
15357
|
-
|
|
15382
|
+
if (!this.options.doFullIce) {
|
|
15383
|
+
parsedOffer.media
|
|
15384
|
+
.filter((media) => media instanceof ApplicationMediaDescription)
|
|
15385
|
+
.forEach((media) => {
|
|
15386
|
+
injectDummyCandidates(media);
|
|
15387
|
+
});
|
|
15388
|
+
}
|
|
15358
15389
|
if (BrowserInfo.isFirefox()) {
|
|
15359
15390
|
setupBundle(parsedOffer, this.options.bundlePolicy, this.midPredictor.getMidMap());
|
|
15360
15391
|
if (this.options.bundlePolicy === 'max-bundle') {
|