@webex/web-client-media-engine 3.29.4 → 3.30.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 +17 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +17 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -14503,6 +14503,7 @@ class SendOnlyTransceiver extends Transceiver {
|
|
|
14503
14503
|
this.rtxEnabled = false;
|
|
14504
14504
|
this.streamMuteStateChange = new TypedEvent();
|
|
14505
14505
|
this.streamPublishStateChange = new TypedEvent();
|
|
14506
|
+
this.streamEnded = new TypedEvent();
|
|
14506
14507
|
this.negotiationNeeded = new TypedEvent();
|
|
14507
14508
|
this.namedMediaGroupsChange = new TypedEvent();
|
|
14508
14509
|
this.requestedIdEncodingParamsMap = new Map();
|
|
@@ -14515,6 +14516,7 @@ class SendOnlyTransceiver extends Transceiver {
|
|
|
14515
14516
|
this.handleTrackChange = this.handleTrackChange.bind(this);
|
|
14516
14517
|
this.handleStreamConstraintsChange = this.handleStreamConstraintsChange.bind(this);
|
|
14517
14518
|
this.handleStreamMuteStateChange = this.handleStreamMuteStateChange.bind(this);
|
|
14519
|
+
this.handleStreamEnded = this.handleStreamEnded.bind(this);
|
|
14518
14520
|
}
|
|
14519
14521
|
replaceSenderSource(stream) {
|
|
14520
14522
|
var _a, _b;
|
|
@@ -14546,6 +14548,9 @@ class SendOnlyTransceiver extends Transceiver {
|
|
|
14546
14548
|
handleStreamMuteStateChange() {
|
|
14547
14549
|
this.streamMuteStateChange.emit();
|
|
14548
14550
|
}
|
|
14551
|
+
handleStreamEnded() {
|
|
14552
|
+
this.streamEnded.emit();
|
|
14553
|
+
}
|
|
14549
14554
|
get requested() {
|
|
14550
14555
|
return this.requestedIdEncodingParamsMap.size > 0;
|
|
14551
14556
|
}
|
|
@@ -14568,6 +14573,7 @@ class SendOnlyTransceiver extends Transceiver {
|
|
|
14568
14573
|
oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(LocalStreamEventNames.ConstraintsChange, this.handleStreamConstraintsChange);
|
|
14569
14574
|
oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(LocalStreamEventNames.UserMuteStateChange, this.handleStreamMuteStateChange);
|
|
14570
14575
|
oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(LocalStreamEventNames.SystemMuteStateChange, this.handleStreamMuteStateChange);
|
|
14576
|
+
oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(StreamEventNames.Ended, this.handleStreamEnded);
|
|
14571
14577
|
if (this.requested) {
|
|
14572
14578
|
yield this.replaceSenderSource(newStream);
|
|
14573
14579
|
}
|
|
@@ -14576,6 +14582,7 @@ class SendOnlyTransceiver extends Transceiver {
|
|
|
14576
14582
|
newStream === null || newStream === void 0 ? void 0 : newStream.on(LocalStreamEventNames.ConstraintsChange, this.handleStreamConstraintsChange);
|
|
14577
14583
|
newStream === null || newStream === void 0 ? void 0 : newStream.on(LocalStreamEventNames.UserMuteStateChange, this.handleStreamMuteStateChange);
|
|
14578
14584
|
newStream === null || newStream === void 0 ? void 0 : newStream.on(LocalStreamEventNames.SystemMuteStateChange, this.handleStreamMuteStateChange);
|
|
14585
|
+
newStream === null || newStream === void 0 ? void 0 : newStream.on(StreamEventNames.Ended, this.handleStreamEnded);
|
|
14579
14586
|
if ((!oldStream && newStream && !newStream.muted) ||
|
|
14580
14587
|
(oldStream && !newStream && !oldStream.muted)) {
|
|
14581
14588
|
this.streamPublishStateChange.emit();
|
|
@@ -15057,6 +15064,10 @@ class MultistreamConnection extends EventEmitter$2 {
|
|
|
15057
15064
|
this.sendSourceAdvertisement(mediaType);
|
|
15058
15065
|
this.sendMediaRequestStatus(mediaType);
|
|
15059
15066
|
});
|
|
15067
|
+
transceiver.streamEnded.on(() => {
|
|
15068
|
+
this.sendSourceAdvertisement(mediaType);
|
|
15069
|
+
this.sendMediaRequestStatus(mediaType);
|
|
15070
|
+
});
|
|
15060
15071
|
transceiver.negotiationNeeded.on((offerAnswerType) => {
|
|
15061
15072
|
if (offerAnswerType === OfferAnswerType.Remote) {
|
|
15062
15073
|
this.emit(MultistreamConnectionEventNames.NegotiationNeeded);
|
|
@@ -15286,9 +15297,12 @@ SCTP Max Message Size: ${maxMessageSize}`);
|
|
|
15286
15297
|
}
|
|
15287
15298
|
}
|
|
15288
15299
|
sendSourceAdvertisement(mediaType) {
|
|
15289
|
-
var _a, _b;
|
|
15300
|
+
var _a, _b, _c;
|
|
15290
15301
|
const transceiver = this.getSendTransceiverOrThrow(mediaType);
|
|
15291
|
-
const numLiveSources = ((_a = transceiver.publishedStream) === null || _a === void 0 ? void 0 : _a.muted) === false
|
|
15302
|
+
const numLiveSources = ((_a = transceiver.publishedStream) === null || _a === void 0 ? void 0 : _a.muted) === false &&
|
|
15303
|
+
((_b = transceiver.publishedStream) === null || _b === void 0 ? void 0 : _b.readyState) === 'live'
|
|
15304
|
+
? 1
|
|
15305
|
+
: 0;
|
|
15292
15306
|
let task;
|
|
15293
15307
|
if (getMediaFamily(mediaType) === MediaFamily.Video) {
|
|
15294
15308
|
const sources = this.getVideoStreamStates(mediaType);
|
|
@@ -15312,7 +15326,7 @@ SCTP Max Message Size: ${maxMessageSize}`);
|
|
|
15312
15326
|
.get(mediaType)) === null || _a === void 0 ? void 0 : _a.sendSourceAdvertisement(1, numLiveSources, mediaType === MediaType.AudioMain ? transceiver.namedMediaGroups : []);
|
|
15313
15327
|
};
|
|
15314
15328
|
}
|
|
15315
|
-
if (((
|
|
15329
|
+
if (((_c = this.dataChannel) === null || _c === void 0 ? void 0 : _c.readyState) === 'open') {
|
|
15316
15330
|
task();
|
|
15317
15331
|
}
|
|
15318
15332
|
else {
|