@webex/web-client-media-engine 3.8.3 → 3.8.4
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 +17 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +17 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -13836,11 +13836,23 @@ class SendOnlyTransceiver extends Transceiver {
|
|
|
13836
13836
|
this.munger = munger;
|
|
13837
13837
|
this.mediaType = mediaType;
|
|
13838
13838
|
}
|
|
13839
|
-
|
|
13839
|
+
replaceSenderSource(stream) {
|
|
13840
13840
|
var _a;
|
|
13841
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
13842
|
+
const trackOrNull = (_a = stream === null || stream === void 0 ? void 0 : stream.outputStream.getTracks()[0]) !== null && _a !== void 0 ? _a : null;
|
|
13843
|
+
yield this.sender.replaceTrack(trackOrNull);
|
|
13844
|
+
if (trackOrNull) {
|
|
13845
|
+
logger.log(`Sender source for ${this.mediaType} replaced with track ID ${trackOrNull.id}`);
|
|
13846
|
+
}
|
|
13847
|
+
else {
|
|
13848
|
+
logger.log(`Sender source for ${this.mediaType} set to null, sender stopped`);
|
|
13849
|
+
}
|
|
13850
|
+
});
|
|
13851
|
+
}
|
|
13852
|
+
handleTrackChange() {
|
|
13841
13853
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13842
13854
|
if (this.requested) {
|
|
13843
|
-
yield this.
|
|
13855
|
+
yield this.replaceSenderSource(this.publishedStream);
|
|
13844
13856
|
}
|
|
13845
13857
|
});
|
|
13846
13858
|
}
|
|
@@ -13859,12 +13871,11 @@ class SendOnlyTransceiver extends Transceiver {
|
|
|
13859
13871
|
const _super = Object.create(null, {
|
|
13860
13872
|
replaceTransceiver: { get: () => super.replaceTransceiver }
|
|
13861
13873
|
});
|
|
13862
|
-
var _a;
|
|
13863
13874
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13864
13875
|
_super.replaceTransceiver.call(this, newRtcRtpTransceiver);
|
|
13865
13876
|
newRtcRtpTransceiver.direction = this.direction;
|
|
13866
13877
|
if (this.requested) {
|
|
13867
|
-
yield this.
|
|
13878
|
+
yield this.replaceSenderSource(this.publishedStream);
|
|
13868
13879
|
}
|
|
13869
13880
|
});
|
|
13870
13881
|
}
|
|
@@ -13875,7 +13886,7 @@ class SendOnlyTransceiver extends Transceiver {
|
|
|
13875
13886
|
oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(LocalStreamEventNames.ConstraintsChange, this.handleStreamConstraintsChange);
|
|
13876
13887
|
oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(StreamEventNames.MuteStateChange, this.handleStreamMuteStateChange);
|
|
13877
13888
|
if (this.requested) {
|
|
13878
|
-
yield this.
|
|
13889
|
+
yield this.replaceSenderSource(newStream);
|
|
13879
13890
|
}
|
|
13880
13891
|
this.publishedStream = newStream;
|
|
13881
13892
|
newStream === null || newStream === void 0 ? void 0 : newStream.on(LocalStreamEventNames.OutputTrackChange, this.handleTrackChange);
|
|
@@ -13922,7 +13933,7 @@ class SendOnlyTransceiver extends Transceiver {
|
|
|
13922
13933
|
if (this.publishedStream) {
|
|
13923
13934
|
const requested = requestedIdEncodingParamsMap.size > 0;
|
|
13924
13935
|
if (this.requested !== requested) {
|
|
13925
|
-
this.
|
|
13936
|
+
this.replaceSenderSource(requested ? this.publishedStream : null);
|
|
13926
13937
|
}
|
|
13927
13938
|
const sendParameters = this.sender.getParameters();
|
|
13928
13939
|
sendParameters.encodings.forEach((encoding, index) => {
|