@webex/internal-media-core 1.33.2 → 1.34.1
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
|
@@ -9031,11 +9031,11 @@ function isValidSourceIndicationAckMsg(msg) {
|
|
|
9031
9031
|
var maybeSourceIndicationAckMsg = msg;
|
|
9032
9032
|
return Boolean(maybeSourceIndicationAckMsg.sourceIndicationSeqNum);
|
|
9033
9033
|
}
|
|
9034
|
-
var MediaFamily
|
|
9034
|
+
var MediaFamily;
|
|
9035
9035
|
(function (MediaFamily) {
|
|
9036
9036
|
MediaFamily["Audio"] = "AUDIO";
|
|
9037
9037
|
MediaFamily["Video"] = "VIDEO";
|
|
9038
|
-
})(MediaFamily
|
|
9038
|
+
})(MediaFamily || (MediaFamily = {}));
|
|
9039
9039
|
var MediaContent$1;
|
|
9040
9040
|
(function (MediaContent) {
|
|
9041
9041
|
MediaContent["Main"] = "MAIN";
|
|
@@ -9061,7 +9061,7 @@ function generateSceneId() {
|
|
|
9061
9061
|
}
|
|
9062
9062
|
function generateCsi(mediaFamily, sceneId) {
|
|
9063
9063
|
var av;
|
|
9064
|
-
if (mediaFamily === MediaFamily
|
|
9064
|
+
if (mediaFamily === MediaFamily.Audio) {
|
|
9065
9065
|
av = 0;
|
|
9066
9066
|
} else {
|
|
9067
9067
|
av = 1;
|
|
@@ -9069,19 +9069,19 @@ function generateCsi(mediaFamily, sceneId) {
|
|
|
9069
9069
|
return sceneId << 8 | av;
|
|
9070
9070
|
}
|
|
9071
9071
|
function getMediaType(mediaFamily, mediaContent) {
|
|
9072
|
-
if (mediaFamily === MediaFamily
|
|
9072
|
+
if (mediaFamily === MediaFamily.Video && mediaContent === MediaContent$1.Main) {
|
|
9073
9073
|
return MediaType.VideoMain;
|
|
9074
9074
|
}
|
|
9075
|
-
if (mediaFamily === MediaFamily
|
|
9075
|
+
if (mediaFamily === MediaFamily.Video && mediaContent === MediaContent$1.Slides) {
|
|
9076
9076
|
return MediaType.VideoSlides;
|
|
9077
9077
|
}
|
|
9078
|
-
if (mediaFamily === MediaFamily
|
|
9078
|
+
if (mediaFamily === MediaFamily.Audio && mediaContent === MediaContent$1.Main) {
|
|
9079
9079
|
return MediaType.AudioMain;
|
|
9080
9080
|
}
|
|
9081
9081
|
return MediaType.AudioSlides;
|
|
9082
9082
|
}
|
|
9083
|
-
function getMediaFamily(mediaType) {
|
|
9084
|
-
return [MediaType.VideoMain, MediaType.VideoSlides].includes(mediaType) ? MediaFamily
|
|
9083
|
+
function getMediaFamily$1(mediaType) {
|
|
9084
|
+
return [MediaType.VideoMain, MediaType.VideoSlides].includes(mediaType) ? MediaFamily.Video : MediaFamily.Audio;
|
|
9085
9085
|
}
|
|
9086
9086
|
function getMediaContent(mediaType) {
|
|
9087
9087
|
return [MediaType.VideoMain, MediaType.AudioMain].includes(mediaType) ? MediaContent$1.Main : MediaContent$1.Slides;
|
|
@@ -11863,6 +11863,7 @@ class ReceiveSlot extends EventEmitter {
|
|
|
11863
11863
|
this.handleTrackMuted = this.handleTrackMuted.bind(this);
|
|
11864
11864
|
this.handleTrackUnmuted = this.handleTrackUnmuted.bind(this);
|
|
11865
11865
|
this._stream = new MediaStream([track]);
|
|
11866
|
+
this._sourceState = 'no source';
|
|
11866
11867
|
this.addTrackHandlers(track);
|
|
11867
11868
|
}
|
|
11868
11869
|
addTrackHandlers(track) {
|
|
@@ -11890,8 +11891,11 @@ class ReceiveSlot extends EventEmitter {
|
|
|
11890
11891
|
this._stream.addTrack(newTrack);
|
|
11891
11892
|
}
|
|
11892
11893
|
_updateSource(state, csi) {
|
|
11893
|
-
this.
|
|
11894
|
-
|
|
11894
|
+
if (state !== this._sourceState || csi !== this._currentRxCsi) {
|
|
11895
|
+
this._sourceState = state;
|
|
11896
|
+
this._currentRxCsi = csi;
|
|
11897
|
+
this.emit(exports.ReceiveSlotEvents.SourceUpdate, state, csi);
|
|
11898
|
+
}
|
|
11895
11899
|
}
|
|
11896
11900
|
close() {
|
|
11897
11901
|
this._stream.getTracks().forEach(t => {
|
|
@@ -11904,6 +11908,9 @@ class ReceiveSlot extends EventEmitter {
|
|
|
11904
11908
|
get stream() {
|
|
11905
11909
|
return this._stream;
|
|
11906
11910
|
}
|
|
11911
|
+
get currentRxCsi() {
|
|
11912
|
+
return this._currentRxCsi;
|
|
11913
|
+
}
|
|
11907
11914
|
}
|
|
11908
11915
|
ReceiveSlot.Events = exports.ReceiveSlotEvents;
|
|
11909
11916
|
class Transceiver {
|
|
@@ -12019,10 +12026,10 @@ function deepCopy(source) {
|
|
|
12019
12026
|
function getMediaTypeForMline(mLine) {
|
|
12020
12027
|
var _a, _b;
|
|
12021
12028
|
var mediaFamily;
|
|
12022
|
-
if (mLine.type.toLowerCase() === MediaFamily
|
|
12023
|
-
mediaFamily = MediaFamily
|
|
12024
|
-
} else if (mLine.type.toLowerCase() === MediaFamily
|
|
12025
|
-
mediaFamily = MediaFamily
|
|
12029
|
+
if (mLine.type.toLowerCase() === MediaFamily.Audio.toLowerCase()) {
|
|
12030
|
+
mediaFamily = MediaFamily.Audio;
|
|
12031
|
+
} else if (mLine.type.toLowerCase() === MediaFamily.Video.toLowerCase()) {
|
|
12032
|
+
mediaFamily = MediaFamily.Video;
|
|
12026
12033
|
} else {
|
|
12027
12034
|
throw Error("Mline type doesn't match any known MediaFamily: ".concat(mLine.type));
|
|
12028
12035
|
}
|
|
@@ -14113,9 +14120,9 @@ function toMediaStreamTrackKind(mediaType) {
|
|
|
14113
14120
|
}
|
|
14114
14121
|
function toMediaFamily(kind) {
|
|
14115
14122
|
if (kind === MediaStreamTrackKind.Video) {
|
|
14116
|
-
return MediaFamily
|
|
14123
|
+
return MediaFamily.Video;
|
|
14117
14124
|
}
|
|
14118
|
-
return MediaFamily
|
|
14125
|
+
return MediaFamily.Audio;
|
|
14119
14126
|
}
|
|
14120
14127
|
var MultistreamConnectionEventNames;
|
|
14121
14128
|
(function (MultistreamConnectionEventNames) {
|
|
@@ -14199,17 +14206,23 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14199
14206
|
}];
|
|
14200
14207
|
}
|
|
14201
14208
|
createSendTransceiver(mediaType, sceneId, sendEncodingsOptions) {
|
|
14202
|
-
var rtcTransceiver
|
|
14203
|
-
|
|
14204
|
-
|
|
14205
|
-
|
|
14209
|
+
var rtcTransceiver;
|
|
14210
|
+
try {
|
|
14211
|
+
rtcTransceiver = this.pc.addTransceiver(toMediaStreamTrackKind(mediaType), {
|
|
14212
|
+
direction: 'sendrecv',
|
|
14213
|
+
sendEncodings: sendEncodingsOptions
|
|
14214
|
+
});
|
|
14215
|
+
} catch (e) {
|
|
14216
|
+
logger$4.error("addTransceiver failed due to : ".concat(e));
|
|
14217
|
+
throw e;
|
|
14218
|
+
}
|
|
14206
14219
|
this.addMid(mediaType);
|
|
14207
|
-
var csi = generateCsi(getMediaFamily(mediaType), sceneId);
|
|
14220
|
+
var csi = generateCsi(getMediaFamily$1(mediaType), sceneId);
|
|
14208
14221
|
this.sendTransceivers.set(mediaType, new SendOnlyTransceiver(rtcTransceiver, csi));
|
|
14209
14222
|
this.createJmpSession(mediaType);
|
|
14210
14223
|
}
|
|
14211
14224
|
createJmpSession(mediaType) {
|
|
14212
|
-
var jmpSession = new JmpSession(getMediaFamily(mediaType), getMediaContent(mediaType));
|
|
14225
|
+
var jmpSession = new JmpSession(getMediaFamily$1(mediaType), getMediaContent(mediaType));
|
|
14213
14226
|
jmpSession.setTxCallback(msg => {
|
|
14214
14227
|
var _a;
|
|
14215
14228
|
if (((_a = this.dataChannel) === null || _a === void 0 ? void 0 : _a.readyState) !== 'open') {
|
|
@@ -14219,9 +14232,10 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14219
14232
|
logger$4.info("Sending JMP message: ".concat(msg));
|
|
14220
14233
|
this.dataChannel.send(msg);
|
|
14221
14234
|
});
|
|
14222
|
-
if (getMediaFamily(mediaType) === MediaFamily
|
|
14235
|
+
if (getMediaFamily$1(mediaType) === MediaFamily.Video) {
|
|
14236
|
+
var prevNumTotalSources = 0;
|
|
14237
|
+
var prevNumLiveSources = 0;
|
|
14223
14238
|
jmpSession.on(JmpSessionEvents$1.SourceIndication, data => {
|
|
14224
|
-
this.emit(MultistreamConnectionEventNames.VideoSourceCountUpdate, data.numTotalSources, data.numLiveSources);
|
|
14225
14239
|
data.sources.forEach(s => {
|
|
14226
14240
|
var receiveSlot = this.getReceiveSlotById(s.id);
|
|
14227
14241
|
if (!receiveSlot) {
|
|
@@ -14230,15 +14244,21 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14230
14244
|
}
|
|
14231
14245
|
receiveSlot._updateSource(s.state, s.csi);
|
|
14232
14246
|
});
|
|
14247
|
+
if (data.numTotalSources !== prevNumTotalSources || data.numLiveSources !== prevNumLiveSources) {
|
|
14248
|
+
prevNumTotalSources = data.numTotalSources;
|
|
14249
|
+
prevNumLiveSources = data.numLiveSources;
|
|
14250
|
+
this.emit(MultistreamConnectionEventNames.VideoSourceCountUpdate, data.numTotalSources, data.numLiveSources, getMediaContent(mediaType));
|
|
14251
|
+
}
|
|
14233
14252
|
});
|
|
14234
14253
|
jmpSession.on(JmpSessionEvents$1.ScrRequestReceived, data => {
|
|
14235
14254
|
this.sendSourceWarnings(mediaType, data.requests);
|
|
14236
14255
|
this.updateRequestedStreams(mediaType, data.requests);
|
|
14237
14256
|
});
|
|
14238
14257
|
}
|
|
14239
|
-
if (getMediaFamily(mediaType) === MediaFamily
|
|
14258
|
+
if (getMediaFamily$1(mediaType) === MediaFamily.Audio) {
|
|
14259
|
+
var _prevNumTotalSources = 0;
|
|
14260
|
+
var _prevNumLiveSources = 0;
|
|
14240
14261
|
jmpSession.on(JmpSessionEvents$1.SourceIndication, data => {
|
|
14241
|
-
this.emit(MultistreamConnectionEventNames.AudioSourceCountUpdate, data.numTotalSources, data.numLiveSources);
|
|
14242
14262
|
data.sources.forEach(s => {
|
|
14243
14263
|
var receiveSlot = this.getReceiveSlotById(s.id);
|
|
14244
14264
|
if (!receiveSlot) {
|
|
@@ -14247,6 +14267,11 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14247
14267
|
}
|
|
14248
14268
|
receiveSlot._updateSource(s.state, s.csi);
|
|
14249
14269
|
});
|
|
14270
|
+
if (data.numTotalSources !== _prevNumTotalSources || data.numLiveSources !== _prevNumLiveSources) {
|
|
14271
|
+
_prevNumTotalSources = data.numTotalSources;
|
|
14272
|
+
_prevNumLiveSources = data.numLiveSources;
|
|
14273
|
+
this.emit(MultistreamConnectionEventNames.AudioSourceCountUpdate, data.numTotalSources, data.numLiveSources, getMediaContent(mediaType));
|
|
14274
|
+
}
|
|
14250
14275
|
});
|
|
14251
14276
|
jmpSession.on(JmpSessionEvents$1.ActiveSpeaker, data => this.emit(MultistreamConnectionEventNames.ActiveSpeakerNotification, data));
|
|
14252
14277
|
jmpSession.on(JmpSessionEvents$1.ScrRequestReceived, data => {
|
|
@@ -14256,7 +14281,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14256
14281
|
this.jmpSessions.set(mediaType, jmpSession);
|
|
14257
14282
|
}
|
|
14258
14283
|
sendSourceWarnings(mediaType, requests) {
|
|
14259
|
-
if (getMediaFamily(mediaType) === MediaFamily
|
|
14284
|
+
if (getMediaFamily$1(mediaType) === MediaFamily.Video) {
|
|
14260
14285
|
var sendTransceiver = this.getSendTransceiverOrThrow(mediaType);
|
|
14261
14286
|
var signaler = this.streamSignalerManager.getEgressStreamSignalerOrThrow(sendTransceiver.mid);
|
|
14262
14287
|
var sourceWarnings = [];
|
|
@@ -14334,7 +14359,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14334
14359
|
}
|
|
14335
14360
|
});
|
|
14336
14361
|
sendTransceiver.setTrackRequested(requestedIdEncodingParamsMap.size > 0);
|
|
14337
|
-
if (getMediaFamily(mediaType) === MediaFamily
|
|
14362
|
+
if (getMediaFamily$1(mediaType) === MediaFamily.Video) {
|
|
14338
14363
|
sendTransceiver.updateSimulcastStreamStates(requestedIdEncodingParamsMap);
|
|
14339
14364
|
}
|
|
14340
14365
|
}
|
|
@@ -14345,7 +14370,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14345
14370
|
this.sendTransceivers.forEach((transceiver, mediaType) => {
|
|
14346
14371
|
var track = transceiver.publishedTrack;
|
|
14347
14372
|
if (track) {
|
|
14348
|
-
if (getMediaFamily(mediaType) === MediaFamily
|
|
14373
|
+
if (getMediaFamily$1(mediaType) === MediaFamily.Audio) {
|
|
14349
14374
|
this.sendSourceIndication(mediaType, +!track.muted);
|
|
14350
14375
|
} else {
|
|
14351
14376
|
var signaler = this.streamSignalerManager.getEgressStreamSignalerOrThrow(transceiver.mid);
|
|
@@ -14461,7 +14486,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14461
14486
|
return;
|
|
14462
14487
|
}
|
|
14463
14488
|
if (this.getPublishedTracks().includes(track)) {
|
|
14464
|
-
if (getMediaFamily(mediaType) === MediaFamily
|
|
14489
|
+
if (getMediaFamily$1(mediaType) === MediaFamily.Audio) {
|
|
14465
14490
|
this.sendSourceIndication(mediaType, +!event.trackState.muted);
|
|
14466
14491
|
} else {
|
|
14467
14492
|
var state = event.trackState.muted ? 'avatar' : 'live';
|
|
@@ -14486,7 +14511,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14486
14511
|
return;
|
|
14487
14512
|
}
|
|
14488
14513
|
if (!event.trackState.muted) {
|
|
14489
|
-
if (getMediaFamily(mediaType) === MediaFamily
|
|
14514
|
+
if (getMediaFamily$1(mediaType) === MediaFamily.Audio) {
|
|
14490
14515
|
this.sendSourceIndication(mediaType, +event.isPublished);
|
|
14491
14516
|
} else {
|
|
14492
14517
|
var state = event.isPublished ? 'live' : 'no source';
|
|
@@ -14692,9 +14717,9 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14692
14717
|
this.addMid(mediaType);
|
|
14693
14718
|
transceiver.replaceTransceiver(this.pc.addTransceiver(toMediaStreamTrackKind(mediaType), {
|
|
14694
14719
|
direction: 'sendrecv',
|
|
14695
|
-
sendEncodings: getMediaFamily(mediaType) === MediaFamily
|
|
14720
|
+
sendEncodings: getMediaFamily$1(mediaType) === MediaFamily.Video ? this.getVideoEncodingOptions() : undefined
|
|
14696
14721
|
}));
|
|
14697
|
-
transceiver.csi = generateCsi(getMediaFamily(mediaType), mainSceneId);
|
|
14722
|
+
transceiver.csi = generateCsi(getMediaFamily$1(mediaType), mainSceneId);
|
|
14698
14723
|
(_a = this.jmpSessions.get(mediaType)) === null || _a === void 0 ? void 0 : _a.close();
|
|
14699
14724
|
this.createJmpSession(mediaType);
|
|
14700
14725
|
});
|
|
@@ -23701,11 +23726,11 @@ class ReceiverSelectedInfo {
|
|
|
23701
23726
|
return "ReceiverSelectedInfo(csi=".concat(this.csi, ")");
|
|
23702
23727
|
}
|
|
23703
23728
|
}
|
|
23704
|
-
|
|
23729
|
+
exports.MediaFamily = void 0;
|
|
23705
23730
|
(function (MediaFamily) {
|
|
23706
23731
|
MediaFamily["Audio"] = "AUDIO";
|
|
23707
23732
|
MediaFamily["Video"] = "VIDEO";
|
|
23708
|
-
})(MediaFamily || (MediaFamily = {}));
|
|
23733
|
+
})(exports.MediaFamily || (exports.MediaFamily = {}));
|
|
23709
23734
|
var MediaContent;
|
|
23710
23735
|
(function (MediaContent) {
|
|
23711
23736
|
MediaContent["Main"] = "MAIN";
|
|
@@ -23723,6 +23748,9 @@ exports.MediaType = void 0;
|
|
|
23723
23748
|
MediaType["AudioMain"] = "AUDIO-MAIN";
|
|
23724
23749
|
MediaType["AudioSlides"] = "AUDIO-SLIDES";
|
|
23725
23750
|
})(exports.MediaType || (exports.MediaType = {}));
|
|
23751
|
+
function getMediaFamily(mediaType) {
|
|
23752
|
+
return [exports.MediaType.VideoMain, exports.MediaType.VideoSlides].includes(mediaType) ? exports.MediaFamily.Video : exports.MediaFamily.Audio;
|
|
23753
|
+
}
|
|
23726
23754
|
var JmpSessionEvents;
|
|
23727
23755
|
(function (JmpSessionEvents) {
|
|
23728
23756
|
JmpSessionEvents["SourceIndication"] = "source-indication";
|
|
@@ -23766,11 +23794,11 @@ class MultistreamRoapMediaConnection extends EventEmitter$4 {
|
|
|
23766
23794
|
csis: data.csis
|
|
23767
23795
|
});
|
|
23768
23796
|
});
|
|
23769
|
-
multistreamConnection.on(MultistreamConnectionEventNames.AudioSourceCountUpdate, (numTotalSources, numLiveSources) => {
|
|
23770
|
-
this.emit(exports.Event.AUDIO_SOURCES_COUNT_CHANGED, numTotalSources, numLiveSources);
|
|
23797
|
+
multistreamConnection.on(MultistreamConnectionEventNames.AudioSourceCountUpdate, (numTotalSources, numLiveSources, mediaContent) => {
|
|
23798
|
+
this.emit(exports.Event.AUDIO_SOURCES_COUNT_CHANGED, numTotalSources, numLiveSources, mediaContent);
|
|
23771
23799
|
});
|
|
23772
|
-
multistreamConnection.on(MultistreamConnectionEventNames.VideoSourceCountUpdate, (numTotalSources, numLiveSources) => {
|
|
23773
|
-
this.emit(exports.Event.VIDEO_SOURCES_COUNT_CHANGED, numTotalSources, numLiveSources);
|
|
23800
|
+
multistreamConnection.on(MultistreamConnectionEventNames.VideoSourceCountUpdate, (numTotalSources, numLiveSources, mediaContent) => {
|
|
23801
|
+
this.emit(exports.Event.VIDEO_SOURCES_COUNT_CHANGED, numTotalSources, numLiveSources, mediaContent);
|
|
23774
23802
|
});
|
|
23775
23803
|
multistreamConnection.on(MultistreamConnectionEventNames.ConnectionStateUpdate, state => {
|
|
23776
23804
|
this.emit(exports.Event.CONNECTION_STATE_CHANGED, {
|
|
@@ -23963,5 +23991,6 @@ exports.ReceiverSelectedInfo = ReceiverSelectedInfo;
|
|
|
23963
23991
|
exports.RoapMediaConnection = RoapMediaConnection;
|
|
23964
23992
|
exports.getErrorDescription = getErrorDescription;
|
|
23965
23993
|
exports.getLogger = getLogger;
|
|
23994
|
+
exports.getMediaFamily = getMediaFamily;
|
|
23966
23995
|
exports.isBrowserSupported = isBrowserSupported;
|
|
23967
23996
|
exports.setLogger = setLogger;
|
package/dist/esm/index.js
CHANGED
|
@@ -9069,7 +9069,7 @@ function getMediaType(mediaFamily, mediaContent) {
|
|
|
9069
9069
|
}
|
|
9070
9070
|
return MediaType$1.AudioSlides;
|
|
9071
9071
|
}
|
|
9072
|
-
function getMediaFamily(mediaType) {
|
|
9072
|
+
function getMediaFamily$1(mediaType) {
|
|
9073
9073
|
return [MediaType$1.VideoMain, MediaType$1.VideoSlides].includes(mediaType) ? MediaFamily$1.Video : MediaFamily$1.Audio;
|
|
9074
9074
|
}
|
|
9075
9075
|
function getMediaContent(mediaType) {
|
|
@@ -11852,6 +11852,7 @@ class ReceiveSlot extends EventEmitter {
|
|
|
11852
11852
|
this.handleTrackMuted = this.handleTrackMuted.bind(this);
|
|
11853
11853
|
this.handleTrackUnmuted = this.handleTrackUnmuted.bind(this);
|
|
11854
11854
|
this._stream = new MediaStream([track]);
|
|
11855
|
+
this._sourceState = 'no source';
|
|
11855
11856
|
this.addTrackHandlers(track);
|
|
11856
11857
|
}
|
|
11857
11858
|
addTrackHandlers(track) {
|
|
@@ -11879,8 +11880,11 @@ class ReceiveSlot extends EventEmitter {
|
|
|
11879
11880
|
this._stream.addTrack(newTrack);
|
|
11880
11881
|
}
|
|
11881
11882
|
_updateSource(state, csi) {
|
|
11882
|
-
this.
|
|
11883
|
-
|
|
11883
|
+
if (state !== this._sourceState || csi !== this._currentRxCsi) {
|
|
11884
|
+
this._sourceState = state;
|
|
11885
|
+
this._currentRxCsi = csi;
|
|
11886
|
+
this.emit(ReceiveSlotEvents.SourceUpdate, state, csi);
|
|
11887
|
+
}
|
|
11884
11888
|
}
|
|
11885
11889
|
close() {
|
|
11886
11890
|
this._stream.getTracks().forEach(t => {
|
|
@@ -11893,6 +11897,9 @@ class ReceiveSlot extends EventEmitter {
|
|
|
11893
11897
|
get stream() {
|
|
11894
11898
|
return this._stream;
|
|
11895
11899
|
}
|
|
11900
|
+
get currentRxCsi() {
|
|
11901
|
+
return this._currentRxCsi;
|
|
11902
|
+
}
|
|
11896
11903
|
}
|
|
11897
11904
|
ReceiveSlot.Events = ReceiveSlotEvents;
|
|
11898
11905
|
class Transceiver {
|
|
@@ -14188,17 +14195,23 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14188
14195
|
}];
|
|
14189
14196
|
}
|
|
14190
14197
|
createSendTransceiver(mediaType, sceneId, sendEncodingsOptions) {
|
|
14191
|
-
var rtcTransceiver
|
|
14192
|
-
|
|
14193
|
-
|
|
14194
|
-
|
|
14198
|
+
var rtcTransceiver;
|
|
14199
|
+
try {
|
|
14200
|
+
rtcTransceiver = this.pc.addTransceiver(toMediaStreamTrackKind(mediaType), {
|
|
14201
|
+
direction: 'sendrecv',
|
|
14202
|
+
sendEncodings: sendEncodingsOptions
|
|
14203
|
+
});
|
|
14204
|
+
} catch (e) {
|
|
14205
|
+
logger$4.error("addTransceiver failed due to : ".concat(e));
|
|
14206
|
+
throw e;
|
|
14207
|
+
}
|
|
14195
14208
|
this.addMid(mediaType);
|
|
14196
|
-
var csi = generateCsi(getMediaFamily(mediaType), sceneId);
|
|
14209
|
+
var csi = generateCsi(getMediaFamily$1(mediaType), sceneId);
|
|
14197
14210
|
this.sendTransceivers.set(mediaType, new SendOnlyTransceiver(rtcTransceiver, csi));
|
|
14198
14211
|
this.createJmpSession(mediaType);
|
|
14199
14212
|
}
|
|
14200
14213
|
createJmpSession(mediaType) {
|
|
14201
|
-
var jmpSession = new JmpSession(getMediaFamily(mediaType), getMediaContent(mediaType));
|
|
14214
|
+
var jmpSession = new JmpSession(getMediaFamily$1(mediaType), getMediaContent(mediaType));
|
|
14202
14215
|
jmpSession.setTxCallback(msg => {
|
|
14203
14216
|
var _a;
|
|
14204
14217
|
if (((_a = this.dataChannel) === null || _a === void 0 ? void 0 : _a.readyState) !== 'open') {
|
|
@@ -14208,9 +14221,10 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14208
14221
|
logger$4.info("Sending JMP message: ".concat(msg));
|
|
14209
14222
|
this.dataChannel.send(msg);
|
|
14210
14223
|
});
|
|
14211
|
-
if (getMediaFamily(mediaType) === MediaFamily$1.Video) {
|
|
14224
|
+
if (getMediaFamily$1(mediaType) === MediaFamily$1.Video) {
|
|
14225
|
+
var prevNumTotalSources = 0;
|
|
14226
|
+
var prevNumLiveSources = 0;
|
|
14212
14227
|
jmpSession.on(JmpSessionEvents$1.SourceIndication, data => {
|
|
14213
|
-
this.emit(MultistreamConnectionEventNames.VideoSourceCountUpdate, data.numTotalSources, data.numLiveSources);
|
|
14214
14228
|
data.sources.forEach(s => {
|
|
14215
14229
|
var receiveSlot = this.getReceiveSlotById(s.id);
|
|
14216
14230
|
if (!receiveSlot) {
|
|
@@ -14219,15 +14233,21 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14219
14233
|
}
|
|
14220
14234
|
receiveSlot._updateSource(s.state, s.csi);
|
|
14221
14235
|
});
|
|
14236
|
+
if (data.numTotalSources !== prevNumTotalSources || data.numLiveSources !== prevNumLiveSources) {
|
|
14237
|
+
prevNumTotalSources = data.numTotalSources;
|
|
14238
|
+
prevNumLiveSources = data.numLiveSources;
|
|
14239
|
+
this.emit(MultistreamConnectionEventNames.VideoSourceCountUpdate, data.numTotalSources, data.numLiveSources, getMediaContent(mediaType));
|
|
14240
|
+
}
|
|
14222
14241
|
});
|
|
14223
14242
|
jmpSession.on(JmpSessionEvents$1.ScrRequestReceived, data => {
|
|
14224
14243
|
this.sendSourceWarnings(mediaType, data.requests);
|
|
14225
14244
|
this.updateRequestedStreams(mediaType, data.requests);
|
|
14226
14245
|
});
|
|
14227
14246
|
}
|
|
14228
|
-
if (getMediaFamily(mediaType) === MediaFamily$1.Audio) {
|
|
14247
|
+
if (getMediaFamily$1(mediaType) === MediaFamily$1.Audio) {
|
|
14248
|
+
var _prevNumTotalSources = 0;
|
|
14249
|
+
var _prevNumLiveSources = 0;
|
|
14229
14250
|
jmpSession.on(JmpSessionEvents$1.SourceIndication, data => {
|
|
14230
|
-
this.emit(MultistreamConnectionEventNames.AudioSourceCountUpdate, data.numTotalSources, data.numLiveSources);
|
|
14231
14251
|
data.sources.forEach(s => {
|
|
14232
14252
|
var receiveSlot = this.getReceiveSlotById(s.id);
|
|
14233
14253
|
if (!receiveSlot) {
|
|
@@ -14236,6 +14256,11 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14236
14256
|
}
|
|
14237
14257
|
receiveSlot._updateSource(s.state, s.csi);
|
|
14238
14258
|
});
|
|
14259
|
+
if (data.numTotalSources !== _prevNumTotalSources || data.numLiveSources !== _prevNumLiveSources) {
|
|
14260
|
+
_prevNumTotalSources = data.numTotalSources;
|
|
14261
|
+
_prevNumLiveSources = data.numLiveSources;
|
|
14262
|
+
this.emit(MultistreamConnectionEventNames.AudioSourceCountUpdate, data.numTotalSources, data.numLiveSources, getMediaContent(mediaType));
|
|
14263
|
+
}
|
|
14239
14264
|
});
|
|
14240
14265
|
jmpSession.on(JmpSessionEvents$1.ActiveSpeaker, data => this.emit(MultistreamConnectionEventNames.ActiveSpeakerNotification, data));
|
|
14241
14266
|
jmpSession.on(JmpSessionEvents$1.ScrRequestReceived, data => {
|
|
@@ -14245,7 +14270,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14245
14270
|
this.jmpSessions.set(mediaType, jmpSession);
|
|
14246
14271
|
}
|
|
14247
14272
|
sendSourceWarnings(mediaType, requests) {
|
|
14248
|
-
if (getMediaFamily(mediaType) === MediaFamily$1.Video) {
|
|
14273
|
+
if (getMediaFamily$1(mediaType) === MediaFamily$1.Video) {
|
|
14249
14274
|
var sendTransceiver = this.getSendTransceiverOrThrow(mediaType);
|
|
14250
14275
|
var signaler = this.streamSignalerManager.getEgressStreamSignalerOrThrow(sendTransceiver.mid);
|
|
14251
14276
|
var sourceWarnings = [];
|
|
@@ -14323,7 +14348,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14323
14348
|
}
|
|
14324
14349
|
});
|
|
14325
14350
|
sendTransceiver.setTrackRequested(requestedIdEncodingParamsMap.size > 0);
|
|
14326
|
-
if (getMediaFamily(mediaType) === MediaFamily$1.Video) {
|
|
14351
|
+
if (getMediaFamily$1(mediaType) === MediaFamily$1.Video) {
|
|
14327
14352
|
sendTransceiver.updateSimulcastStreamStates(requestedIdEncodingParamsMap);
|
|
14328
14353
|
}
|
|
14329
14354
|
}
|
|
@@ -14334,7 +14359,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14334
14359
|
this.sendTransceivers.forEach((transceiver, mediaType) => {
|
|
14335
14360
|
var track = transceiver.publishedTrack;
|
|
14336
14361
|
if (track) {
|
|
14337
|
-
if (getMediaFamily(mediaType) === MediaFamily$1.Audio) {
|
|
14362
|
+
if (getMediaFamily$1(mediaType) === MediaFamily$1.Audio) {
|
|
14338
14363
|
this.sendSourceIndication(mediaType, +!track.muted);
|
|
14339
14364
|
} else {
|
|
14340
14365
|
var signaler = this.streamSignalerManager.getEgressStreamSignalerOrThrow(transceiver.mid);
|
|
@@ -14450,7 +14475,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14450
14475
|
return;
|
|
14451
14476
|
}
|
|
14452
14477
|
if (this.getPublishedTracks().includes(track)) {
|
|
14453
|
-
if (getMediaFamily(mediaType) === MediaFamily$1.Audio) {
|
|
14478
|
+
if (getMediaFamily$1(mediaType) === MediaFamily$1.Audio) {
|
|
14454
14479
|
this.sendSourceIndication(mediaType, +!event.trackState.muted);
|
|
14455
14480
|
} else {
|
|
14456
14481
|
var state = event.trackState.muted ? 'avatar' : 'live';
|
|
@@ -14475,7 +14500,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14475
14500
|
return;
|
|
14476
14501
|
}
|
|
14477
14502
|
if (!event.trackState.muted) {
|
|
14478
|
-
if (getMediaFamily(mediaType) === MediaFamily$1.Audio) {
|
|
14503
|
+
if (getMediaFamily$1(mediaType) === MediaFamily$1.Audio) {
|
|
14479
14504
|
this.sendSourceIndication(mediaType, +event.isPublished);
|
|
14480
14505
|
} else {
|
|
14481
14506
|
var state = event.isPublished ? 'live' : 'no source';
|
|
@@ -14681,9 +14706,9 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14681
14706
|
this.addMid(mediaType);
|
|
14682
14707
|
transceiver.replaceTransceiver(this.pc.addTransceiver(toMediaStreamTrackKind(mediaType), {
|
|
14683
14708
|
direction: 'sendrecv',
|
|
14684
|
-
sendEncodings: getMediaFamily(mediaType) === MediaFamily$1.Video ? this.getVideoEncodingOptions() : undefined
|
|
14709
|
+
sendEncodings: getMediaFamily$1(mediaType) === MediaFamily$1.Video ? this.getVideoEncodingOptions() : undefined
|
|
14685
14710
|
}));
|
|
14686
|
-
transceiver.csi = generateCsi(getMediaFamily(mediaType), mainSceneId);
|
|
14711
|
+
transceiver.csi = generateCsi(getMediaFamily$1(mediaType), mainSceneId);
|
|
14687
14712
|
(_a = this.jmpSessions.get(mediaType)) === null || _a === void 0 ? void 0 : _a.close();
|
|
14688
14713
|
this.createJmpSession(mediaType);
|
|
14689
14714
|
});
|
|
@@ -23712,6 +23737,9 @@ var MediaType;
|
|
|
23712
23737
|
MediaType["AudioMain"] = "AUDIO-MAIN";
|
|
23713
23738
|
MediaType["AudioSlides"] = "AUDIO-SLIDES";
|
|
23714
23739
|
})(MediaType || (MediaType = {}));
|
|
23740
|
+
function getMediaFamily(mediaType) {
|
|
23741
|
+
return [MediaType.VideoMain, MediaType.VideoSlides].includes(mediaType) ? MediaFamily.Video : MediaFamily.Audio;
|
|
23742
|
+
}
|
|
23715
23743
|
var JmpSessionEvents;
|
|
23716
23744
|
(function (JmpSessionEvents) {
|
|
23717
23745
|
JmpSessionEvents["SourceIndication"] = "source-indication";
|
|
@@ -23755,11 +23783,11 @@ class MultistreamRoapMediaConnection extends EventEmitter$4 {
|
|
|
23755
23783
|
csis: data.csis
|
|
23756
23784
|
});
|
|
23757
23785
|
});
|
|
23758
|
-
multistreamConnection.on(MultistreamConnectionEventNames.AudioSourceCountUpdate, (numTotalSources, numLiveSources) => {
|
|
23759
|
-
this.emit(Event$1.AUDIO_SOURCES_COUNT_CHANGED, numTotalSources, numLiveSources);
|
|
23786
|
+
multistreamConnection.on(MultistreamConnectionEventNames.AudioSourceCountUpdate, (numTotalSources, numLiveSources, mediaContent) => {
|
|
23787
|
+
this.emit(Event$1.AUDIO_SOURCES_COUNT_CHANGED, numTotalSources, numLiveSources, mediaContent);
|
|
23760
23788
|
});
|
|
23761
|
-
multistreamConnection.on(MultistreamConnectionEventNames.VideoSourceCountUpdate, (numTotalSources, numLiveSources) => {
|
|
23762
|
-
this.emit(Event$1.VIDEO_SOURCES_COUNT_CHANGED, numTotalSources, numLiveSources);
|
|
23789
|
+
multistreamConnection.on(MultistreamConnectionEventNames.VideoSourceCountUpdate, (numTotalSources, numLiveSources, mediaContent) => {
|
|
23790
|
+
this.emit(Event$1.VIDEO_SOURCES_COUNT_CHANGED, numTotalSources, numLiveSources, mediaContent);
|
|
23763
23791
|
});
|
|
23764
23792
|
multistreamConnection.on(MultistreamConnectionEventNames.ConnectionStateUpdate, state => {
|
|
23765
23793
|
this.emit(Event$1.CONNECTION_STATE_CHANGED, {
|
|
@@ -23940,4 +23968,4 @@ var Media = {
|
|
|
23940
23968
|
isBrowserSupported
|
|
23941
23969
|
};
|
|
23942
23970
|
|
|
23943
|
-
export { ActiveSpeakerInfo, CodecInfo, ConnectionState, ErrorType, Errors, Event$1 as Event, H264Codec, Media, MediaRequest, MediaType, MultistreamRoapMediaConnection, Policy, ReceiveSlot, ReceiveSlotEvents, ReceiverSelectedInfo, RemoteTrackType, RoapMediaConnection, getErrorDescription, getLogger, isBrowserSupported, setLogger };
|
|
23971
|
+
export { ActiveSpeakerInfo, CodecInfo, ConnectionState, ErrorType, Errors, Event$1 as Event, H264Codec, Media, MediaFamily, MediaRequest, MediaType, MultistreamRoapMediaConnection, Policy, ReceiveSlot, ReceiveSlotEvents, ReceiverSelectedInfo, RemoteTrackType, RoapMediaConnection, getErrorDescription, getLogger, getMediaFamily, isBrowserSupported, setLogger };
|
|
@@ -5,7 +5,7 @@ import { MediaType } from '@webex/json-multistream';
|
|
|
5
5
|
import { ConnectionState, RoapMessage } from './eventTypes';
|
|
6
6
|
import { MultistreamConnectionConfig } from './config';
|
|
7
7
|
export { MediaRequest, ReceiveSlot, ReceiveSlotEvents } from '@webex/web-client-media-engine';
|
|
8
|
-
export { ActiveSpeakerInfo, CodecInfo, H264Codec, MediaType, SourceState, Policy, PolicySpecificInfo, ReceiverSelectedInfo, } from '@webex/json-multistream';
|
|
8
|
+
export { ActiveSpeakerInfo, CodecInfo, getMediaFamily, H264Codec, MediaFamily, MediaType, SourceState, Policy, PolicySpecificInfo, ReceiverSelectedInfo, } from '@webex/json-multistream';
|
|
9
9
|
export declare class MultistreamRoapMediaConnection extends EventEmitter {
|
|
10
10
|
private id?;
|
|
11
11
|
private debugId?;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultistreamRoapMediaConnection.d.ts","sourceRoot":"","sources":["../../../src/MediaConnection/MultistreamRoapMediaConnection.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC,OAAO,EAKL,YAAY,EAGZ,WAAW,EACX,gBAAgB,EACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"MultistreamRoapMediaConnection.d.ts","sourceRoot":"","sources":["../../../src/MediaConnection/MultistreamRoapMediaConnection.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC,OAAO,EAKL,YAAY,EAGZ,WAAW,EACX,gBAAgB,EACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAA6C,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAG9F,OAAO,EAAQ,eAAe,EAAE,WAAW,EAAmB,MAAM,cAAc,CAAC;AAKnF,OAAO,EAAC,2BAA2B,EAAC,MAAM,UAAU,CAAC;AAGrD,OAAO,EAAC,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AAE5F,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,SAAS,EACT,WAAW,EACX,SAAS,EACT,WAAW,EACX,MAAM,EACN,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;AAGjC,qBAAa,8BAA+B,SAAQ,YAAY;IAC9D,OAAO,CAAC,EAAE,CAAC,CAAS;IAEpB,OAAO,CAAC,OAAO,CAAC,CAAS;IAEzB,OAAO,CAAC,qBAAqB,CAAwB;IAErD,OAAO,CAAC,IAAI,CAAO;IAEnB,OAAO,CAAC,qBAAqB,CAAS;gBAS1B,qBAAqB,EAAE,2BAA2B,EAAE,OAAO,CAAC,EAAE,MAAM;IAehF,OAAO,CAAC,mBAAmB;IAK3B,OAAO,CAAC,GAAG;IAIX,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,2BAA2B;IAyCnC,OAAO,CAAC,UAAU;IA4BX,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAiB9B,KAAK,IAAI,IAAI;IAOpB,OAAO,CAAC,oBAAoB;IAK5B,OAAO,CAAC,eAAe;IAiBhB,SAAS,CAAC,UAAU,EAAE,YAAY,EAAE,EAAE,aAAa,UAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA2B1E,kBAAkB,IAAI,eAAe;IAWrC,QAAQ,IAAI,OAAO,CAAC,cAAc,CAAC;IAOnC,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAShD,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI;IAa7C,YAAY,CACvB,KAAK,EAAE,gBAAgB,EACvB,YAAY,EAAE,MAAM,GAAG,QAAQ,GAC9B,OAAO,CAAC,IAAI,CAAC;IAkCH,cAAc,CACzB,KAAK,EAAE,gBAAgB,EACvB,YAAY,EAAE,MAAM,GAAG,QAAQ,GAC9B,OAAO,CAAC,IAAI,CAAC;IAmCT,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC;IAM7D,YAAY,CAAC,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,IAAI;IAM9E,OAAO,CAAC,gBAAgB;IAkBxB,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,kBAAkB;CAkB3B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/internal-media-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.34.1",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/cjs",
|
|
6
6
|
"dist/esm",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@babel/runtime": "^7.18.9",
|
|
48
48
|
"@webex/json-multistream": "1.20.0",
|
|
49
49
|
"@webex/ts-sdp": "1.3.0",
|
|
50
|
-
"@webex/web-client-media-engine": "1.37.
|
|
50
|
+
"@webex/web-client-media-engine": "1.37.6",
|
|
51
51
|
"detectrtc": "^1.4.1",
|
|
52
52
|
"events": "^3.3.0",
|
|
53
53
|
"typed-emitter": "^2.1.0",
|