@webex/internal-media-core 1.34.0 → 1.35.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
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;
|
|
@@ -9262,7 +9262,7 @@ class JmpSession extends EventEmitter$4 {
|
|
|
9262
9262
|
this.logger.info("Received invalid Active Speaker Notification:", activeSpeakerNotification);
|
|
9263
9263
|
return;
|
|
9264
9264
|
}
|
|
9265
|
-
this.logger.
|
|
9265
|
+
this.logger.debug("Received Active Speaker Notification:", activeSpeakerNotification);
|
|
9266
9266
|
this.emit(JmpSessionEvents$1.ActiveSpeaker, activeSpeakerNotification);
|
|
9267
9267
|
} else if (payload.msgType === JmpMsgType$1.SourceIndication) {
|
|
9268
9268
|
var sourceIndication = payload.payload;
|
|
@@ -12026,10 +12026,10 @@ function deepCopy(source) {
|
|
|
12026
12026
|
function getMediaTypeForMline(mLine) {
|
|
12027
12027
|
var _a, _b;
|
|
12028
12028
|
var mediaFamily;
|
|
12029
|
-
if (mLine.type.toLowerCase() === MediaFamily
|
|
12030
|
-
mediaFamily = MediaFamily
|
|
12031
|
-
} else if (mLine.type.toLowerCase() === MediaFamily
|
|
12032
|
-
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;
|
|
12033
12033
|
} else {
|
|
12034
12034
|
throw Error("Mline type doesn't match any known MediaFamily: ".concat(mLine.type));
|
|
12035
12035
|
}
|
|
@@ -12356,6 +12356,7 @@ class SsrcEgressStreamSignaler {
|
|
|
12356
12356
|
mLine.simulcast = undefined;
|
|
12357
12357
|
mLine.ssrcs = [];
|
|
12358
12358
|
mLine.ssrcGroups = [];
|
|
12359
|
+
mLine.extMaps = mLine.extMaps.filter(extMapLine => !/^urn:ietf:params:rtp-hdrext:sdes:(?:mid|rtp-stream-id|repaired-rtp-stream-id)$/.test(extMapLine.uri));
|
|
12359
12360
|
if (this.streamIds.length === 0) {
|
|
12360
12361
|
var numStreams = simulcastEnabled ? 3 : 1;
|
|
12361
12362
|
[...Array(numStreams).keys()].forEach(() => {
|
|
@@ -14115,14 +14116,18 @@ var Logger$3 = logger$1.exports;
|
|
|
14115
14116
|
var DEFAULT_LOGGER_NAME = 'web-client-media-engine';
|
|
14116
14117
|
var logger$4 = Logger$3.get(DEFAULT_LOGGER_NAME);
|
|
14117
14118
|
logger$4.setLevel(Logger$3.DEBUG);
|
|
14119
|
+
function setLogHandler(logHandler) {
|
|
14120
|
+
Logger$3.setHandler(logHandler);
|
|
14121
|
+
Logger$1.setHandler(logHandler);
|
|
14122
|
+
}
|
|
14118
14123
|
function toMediaStreamTrackKind(mediaType) {
|
|
14119
14124
|
return [MediaType.VideoMain, MediaType.VideoSlides].includes(mediaType) ? MediaStreamTrackKind.Video : MediaStreamTrackKind.Audio;
|
|
14120
14125
|
}
|
|
14121
14126
|
function toMediaFamily(kind) {
|
|
14122
14127
|
if (kind === MediaStreamTrackKind.Video) {
|
|
14123
|
-
return MediaFamily
|
|
14128
|
+
return MediaFamily.Video;
|
|
14124
14129
|
}
|
|
14125
|
-
return MediaFamily
|
|
14130
|
+
return MediaFamily.Audio;
|
|
14126
14131
|
}
|
|
14127
14132
|
var MultistreamConnectionEventNames;
|
|
14128
14133
|
(function (MultistreamConnectionEventNames) {
|
|
@@ -14217,12 +14222,12 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14217
14222
|
throw e;
|
|
14218
14223
|
}
|
|
14219
14224
|
this.addMid(mediaType);
|
|
14220
|
-
var csi = generateCsi(getMediaFamily(mediaType), sceneId);
|
|
14225
|
+
var csi = generateCsi(getMediaFamily$1(mediaType), sceneId);
|
|
14221
14226
|
this.sendTransceivers.set(mediaType, new SendOnlyTransceiver(rtcTransceiver, csi));
|
|
14222
14227
|
this.createJmpSession(mediaType);
|
|
14223
14228
|
}
|
|
14224
14229
|
createJmpSession(mediaType) {
|
|
14225
|
-
var jmpSession = new JmpSession(getMediaFamily(mediaType), getMediaContent(mediaType));
|
|
14230
|
+
var jmpSession = new JmpSession(getMediaFamily$1(mediaType), getMediaContent(mediaType));
|
|
14226
14231
|
jmpSession.setTxCallback(msg => {
|
|
14227
14232
|
var _a;
|
|
14228
14233
|
if (((_a = this.dataChannel) === null || _a === void 0 ? void 0 : _a.readyState) !== 'open') {
|
|
@@ -14232,7 +14237,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14232
14237
|
logger$4.info("Sending JMP message: ".concat(msg));
|
|
14233
14238
|
this.dataChannel.send(msg);
|
|
14234
14239
|
});
|
|
14235
|
-
if (getMediaFamily(mediaType) === MediaFamily
|
|
14240
|
+
if (getMediaFamily$1(mediaType) === MediaFamily.Video) {
|
|
14236
14241
|
var prevNumTotalSources = 0;
|
|
14237
14242
|
var prevNumLiveSources = 0;
|
|
14238
14243
|
jmpSession.on(JmpSessionEvents$1.SourceIndication, data => {
|
|
@@ -14255,7 +14260,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14255
14260
|
this.updateRequestedStreams(mediaType, data.requests);
|
|
14256
14261
|
});
|
|
14257
14262
|
}
|
|
14258
|
-
if (getMediaFamily(mediaType) === MediaFamily
|
|
14263
|
+
if (getMediaFamily$1(mediaType) === MediaFamily.Audio) {
|
|
14259
14264
|
var _prevNumTotalSources = 0;
|
|
14260
14265
|
var _prevNumLiveSources = 0;
|
|
14261
14266
|
jmpSession.on(JmpSessionEvents$1.SourceIndication, data => {
|
|
@@ -14281,7 +14286,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14281
14286
|
this.jmpSessions.set(mediaType, jmpSession);
|
|
14282
14287
|
}
|
|
14283
14288
|
sendSourceWarnings(mediaType, requests) {
|
|
14284
|
-
if (getMediaFamily(mediaType) === MediaFamily
|
|
14289
|
+
if (getMediaFamily$1(mediaType) === MediaFamily.Video) {
|
|
14285
14290
|
var sendTransceiver = this.getSendTransceiverOrThrow(mediaType);
|
|
14286
14291
|
var signaler = this.streamSignalerManager.getEgressStreamSignalerOrThrow(sendTransceiver.mid);
|
|
14287
14292
|
var sourceWarnings = [];
|
|
@@ -14359,7 +14364,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14359
14364
|
}
|
|
14360
14365
|
});
|
|
14361
14366
|
sendTransceiver.setTrackRequested(requestedIdEncodingParamsMap.size > 0);
|
|
14362
|
-
if (getMediaFamily(mediaType) === MediaFamily
|
|
14367
|
+
if (getMediaFamily$1(mediaType) === MediaFamily.Video) {
|
|
14363
14368
|
sendTransceiver.updateSimulcastStreamStates(requestedIdEncodingParamsMap);
|
|
14364
14369
|
}
|
|
14365
14370
|
}
|
|
@@ -14370,7 +14375,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14370
14375
|
this.sendTransceivers.forEach((transceiver, mediaType) => {
|
|
14371
14376
|
var track = transceiver.publishedTrack;
|
|
14372
14377
|
if (track) {
|
|
14373
|
-
if (getMediaFamily(mediaType) === MediaFamily
|
|
14378
|
+
if (getMediaFamily$1(mediaType) === MediaFamily.Audio) {
|
|
14374
14379
|
this.sendSourceIndication(mediaType, +!track.muted);
|
|
14375
14380
|
} else {
|
|
14376
14381
|
var signaler = this.streamSignalerManager.getEgressStreamSignalerOrThrow(transceiver.mid);
|
|
@@ -14398,7 +14403,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14398
14403
|
logger$4.error("Error parsing datachannel JSON: ".concat(err));
|
|
14399
14404
|
return;
|
|
14400
14405
|
}
|
|
14401
|
-
logger$4.
|
|
14406
|
+
logger$4.debug('DataChannel got msg: ', parsed);
|
|
14402
14407
|
var homerMsg = HomerMsg.fromJson(parsed);
|
|
14403
14408
|
if (!homerMsg) {
|
|
14404
14409
|
logger$4.error("Received invalid datachannel message: ".concat(e));
|
|
@@ -14486,7 +14491,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14486
14491
|
return;
|
|
14487
14492
|
}
|
|
14488
14493
|
if (this.getPublishedTracks().includes(track)) {
|
|
14489
|
-
if (getMediaFamily(mediaType) === MediaFamily
|
|
14494
|
+
if (getMediaFamily$1(mediaType) === MediaFamily.Audio) {
|
|
14490
14495
|
this.sendSourceIndication(mediaType, +!event.trackState.muted);
|
|
14491
14496
|
} else {
|
|
14492
14497
|
var state = event.trackState.muted ? 'avatar' : 'live';
|
|
@@ -14511,7 +14516,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14511
14516
|
return;
|
|
14512
14517
|
}
|
|
14513
14518
|
if (!event.trackState.muted) {
|
|
14514
|
-
if (getMediaFamily(mediaType) === MediaFamily
|
|
14519
|
+
if (getMediaFamily$1(mediaType) === MediaFamily.Audio) {
|
|
14515
14520
|
this.sendSourceIndication(mediaType, +event.isPublished);
|
|
14516
14521
|
} else {
|
|
14517
14522
|
var state = event.isPublished ? 'live' : 'no source';
|
|
@@ -14717,9 +14722,9 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14717
14722
|
this.addMid(mediaType);
|
|
14718
14723
|
transceiver.replaceTransceiver(this.pc.addTransceiver(toMediaStreamTrackKind(mediaType), {
|
|
14719
14724
|
direction: 'sendrecv',
|
|
14720
|
-
sendEncodings: getMediaFamily(mediaType) === MediaFamily
|
|
14725
|
+
sendEncodings: getMediaFamily$1(mediaType) === MediaFamily.Video ? this.getVideoEncodingOptions() : undefined
|
|
14721
14726
|
}));
|
|
14722
|
-
transceiver.csi = generateCsi(getMediaFamily(mediaType), mainSceneId);
|
|
14727
|
+
transceiver.csi = generateCsi(getMediaFamily$1(mediaType), mainSceneId);
|
|
14723
14728
|
(_a = this.jmpSessions.get(mediaType)) === null || _a === void 0 ? void 0 : _a.close();
|
|
14724
14729
|
this.createJmpSession(mediaType);
|
|
14725
14730
|
});
|
|
@@ -23726,11 +23731,11 @@ class ReceiverSelectedInfo {
|
|
|
23726
23731
|
return "ReceiverSelectedInfo(csi=".concat(this.csi, ")");
|
|
23727
23732
|
}
|
|
23728
23733
|
}
|
|
23729
|
-
|
|
23734
|
+
exports.MediaFamily = void 0;
|
|
23730
23735
|
(function (MediaFamily) {
|
|
23731
23736
|
MediaFamily["Audio"] = "AUDIO";
|
|
23732
23737
|
MediaFamily["Video"] = "VIDEO";
|
|
23733
|
-
})(MediaFamily || (MediaFamily = {}));
|
|
23738
|
+
})(exports.MediaFamily || (exports.MediaFamily = {}));
|
|
23734
23739
|
var MediaContent;
|
|
23735
23740
|
(function (MediaContent) {
|
|
23736
23741
|
MediaContent["Main"] = "MAIN";
|
|
@@ -23748,6 +23753,9 @@ exports.MediaType = void 0;
|
|
|
23748
23753
|
MediaType["AudioMain"] = "AUDIO-MAIN";
|
|
23749
23754
|
MediaType["AudioSlides"] = "AUDIO-SLIDES";
|
|
23750
23755
|
})(exports.MediaType || (exports.MediaType = {}));
|
|
23756
|
+
function getMediaFamily(mediaType) {
|
|
23757
|
+
return [exports.MediaType.VideoMain, exports.MediaType.VideoSlides].includes(mediaType) ? exports.MediaFamily.Video : exports.MediaFamily.Audio;
|
|
23758
|
+
}
|
|
23751
23759
|
var JmpSessionEvents;
|
|
23752
23760
|
(function (JmpSessionEvents) {
|
|
23753
23761
|
JmpSessionEvents["SourceIndication"] = "source-indication";
|
|
@@ -23767,13 +23775,34 @@ class MultistreamRoapMediaConnection extends EventEmitter$4 {
|
|
|
23767
23775
|
_defineProperty__default["default"](this, "sdpNegotiationStarted", false);
|
|
23768
23776
|
this.debugId = debugId;
|
|
23769
23777
|
this.id = debugId || 'MultistreamRoapMediaConnection';
|
|
23770
|
-
this.configureWcmeLogger();
|
|
23778
|
+
this.configureWcmeLogger(debugId);
|
|
23771
23779
|
this.log('constructor()', "config: ".concat(JSON.stringify(mediaConnectionConfig)));
|
|
23772
23780
|
this.multistreamConnection = this.createMultistreamConnection(mediaConnectionConfig);
|
|
23773
23781
|
this.roap = this.createRoap(debugId);
|
|
23774
23782
|
}
|
|
23775
|
-
configureWcmeLogger() {
|
|
23776
|
-
|
|
23783
|
+
configureWcmeLogger(debugId) {
|
|
23784
|
+
var logger = getLogger();
|
|
23785
|
+
setLogHandler((messages, context) => {
|
|
23786
|
+
var logMessages = Array.from(messages).map(message => typeof message === 'object' ? JSON.stringify(message) : message);
|
|
23787
|
+
logMessages.unshift("".concat(debugId || '', ":[").concat(context.name, "]"));
|
|
23788
|
+
switch (context.level.name) {
|
|
23789
|
+
case 'TRACE':
|
|
23790
|
+
logger.trace(...logMessages);
|
|
23791
|
+
break;
|
|
23792
|
+
case 'DEBUG':
|
|
23793
|
+
logger.debug(...logMessages);
|
|
23794
|
+
break;
|
|
23795
|
+
case 'INFO':
|
|
23796
|
+
logger.info(...logMessages);
|
|
23797
|
+
break;
|
|
23798
|
+
case 'WARN':
|
|
23799
|
+
logger.warn(...logMessages);
|
|
23800
|
+
break;
|
|
23801
|
+
case 'ERROR':
|
|
23802
|
+
logger.error(...logMessages);
|
|
23803
|
+
break;
|
|
23804
|
+
}
|
|
23805
|
+
});
|
|
23777
23806
|
}
|
|
23778
23807
|
log(action, description) {
|
|
23779
23808
|
getLogger().info("".concat(this.id, ":").concat(action, " ").concat(description));
|
|
@@ -23988,5 +24017,6 @@ exports.ReceiverSelectedInfo = ReceiverSelectedInfo;
|
|
|
23988
24017
|
exports.RoapMediaConnection = RoapMediaConnection;
|
|
23989
24018
|
exports.getErrorDescription = getErrorDescription;
|
|
23990
24019
|
exports.getLogger = getLogger;
|
|
24020
|
+
exports.getMediaFamily = getMediaFamily;
|
|
23991
24021
|
exports.isBrowserSupported = isBrowserSupported;
|
|
23992
24022
|
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) {
|
|
@@ -9251,7 +9251,7 @@ class JmpSession extends EventEmitter$4 {
|
|
|
9251
9251
|
this.logger.info("Received invalid Active Speaker Notification:", activeSpeakerNotification);
|
|
9252
9252
|
return;
|
|
9253
9253
|
}
|
|
9254
|
-
this.logger.
|
|
9254
|
+
this.logger.debug("Received Active Speaker Notification:", activeSpeakerNotification);
|
|
9255
9255
|
this.emit(JmpSessionEvents$1.ActiveSpeaker, activeSpeakerNotification);
|
|
9256
9256
|
} else if (payload.msgType === JmpMsgType$1.SourceIndication) {
|
|
9257
9257
|
var sourceIndication = payload.payload;
|
|
@@ -12345,6 +12345,7 @@ class SsrcEgressStreamSignaler {
|
|
|
12345
12345
|
mLine.simulcast = undefined;
|
|
12346
12346
|
mLine.ssrcs = [];
|
|
12347
12347
|
mLine.ssrcGroups = [];
|
|
12348
|
+
mLine.extMaps = mLine.extMaps.filter(extMapLine => !/^urn:ietf:params:rtp-hdrext:sdes:(?:mid|rtp-stream-id|repaired-rtp-stream-id)$/.test(extMapLine.uri));
|
|
12348
12349
|
if (this.streamIds.length === 0) {
|
|
12349
12350
|
var numStreams = simulcastEnabled ? 3 : 1;
|
|
12350
12351
|
[...Array(numStreams).keys()].forEach(() => {
|
|
@@ -14104,6 +14105,10 @@ var Logger$3 = logger$1.exports;
|
|
|
14104
14105
|
var DEFAULT_LOGGER_NAME = 'web-client-media-engine';
|
|
14105
14106
|
var logger$4 = Logger$3.get(DEFAULT_LOGGER_NAME);
|
|
14106
14107
|
logger$4.setLevel(Logger$3.DEBUG);
|
|
14108
|
+
function setLogHandler(logHandler) {
|
|
14109
|
+
Logger$3.setHandler(logHandler);
|
|
14110
|
+
Logger$1.setHandler(logHandler);
|
|
14111
|
+
}
|
|
14107
14112
|
function toMediaStreamTrackKind(mediaType) {
|
|
14108
14113
|
return [MediaType$1.VideoMain, MediaType$1.VideoSlides].includes(mediaType) ? MediaStreamTrackKind.Video : MediaStreamTrackKind.Audio;
|
|
14109
14114
|
}
|
|
@@ -14206,12 +14211,12 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14206
14211
|
throw e;
|
|
14207
14212
|
}
|
|
14208
14213
|
this.addMid(mediaType);
|
|
14209
|
-
var csi = generateCsi(getMediaFamily(mediaType), sceneId);
|
|
14214
|
+
var csi = generateCsi(getMediaFamily$1(mediaType), sceneId);
|
|
14210
14215
|
this.sendTransceivers.set(mediaType, new SendOnlyTransceiver(rtcTransceiver, csi));
|
|
14211
14216
|
this.createJmpSession(mediaType);
|
|
14212
14217
|
}
|
|
14213
14218
|
createJmpSession(mediaType) {
|
|
14214
|
-
var jmpSession = new JmpSession(getMediaFamily(mediaType), getMediaContent(mediaType));
|
|
14219
|
+
var jmpSession = new JmpSession(getMediaFamily$1(mediaType), getMediaContent(mediaType));
|
|
14215
14220
|
jmpSession.setTxCallback(msg => {
|
|
14216
14221
|
var _a;
|
|
14217
14222
|
if (((_a = this.dataChannel) === null || _a === void 0 ? void 0 : _a.readyState) !== 'open') {
|
|
@@ -14221,7 +14226,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14221
14226
|
logger$4.info("Sending JMP message: ".concat(msg));
|
|
14222
14227
|
this.dataChannel.send(msg);
|
|
14223
14228
|
});
|
|
14224
|
-
if (getMediaFamily(mediaType) === MediaFamily$1.Video) {
|
|
14229
|
+
if (getMediaFamily$1(mediaType) === MediaFamily$1.Video) {
|
|
14225
14230
|
var prevNumTotalSources = 0;
|
|
14226
14231
|
var prevNumLiveSources = 0;
|
|
14227
14232
|
jmpSession.on(JmpSessionEvents$1.SourceIndication, data => {
|
|
@@ -14244,7 +14249,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14244
14249
|
this.updateRequestedStreams(mediaType, data.requests);
|
|
14245
14250
|
});
|
|
14246
14251
|
}
|
|
14247
|
-
if (getMediaFamily(mediaType) === MediaFamily$1.Audio) {
|
|
14252
|
+
if (getMediaFamily$1(mediaType) === MediaFamily$1.Audio) {
|
|
14248
14253
|
var _prevNumTotalSources = 0;
|
|
14249
14254
|
var _prevNumLiveSources = 0;
|
|
14250
14255
|
jmpSession.on(JmpSessionEvents$1.SourceIndication, data => {
|
|
@@ -14270,7 +14275,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14270
14275
|
this.jmpSessions.set(mediaType, jmpSession);
|
|
14271
14276
|
}
|
|
14272
14277
|
sendSourceWarnings(mediaType, requests) {
|
|
14273
|
-
if (getMediaFamily(mediaType) === MediaFamily$1.Video) {
|
|
14278
|
+
if (getMediaFamily$1(mediaType) === MediaFamily$1.Video) {
|
|
14274
14279
|
var sendTransceiver = this.getSendTransceiverOrThrow(mediaType);
|
|
14275
14280
|
var signaler = this.streamSignalerManager.getEgressStreamSignalerOrThrow(sendTransceiver.mid);
|
|
14276
14281
|
var sourceWarnings = [];
|
|
@@ -14348,7 +14353,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14348
14353
|
}
|
|
14349
14354
|
});
|
|
14350
14355
|
sendTransceiver.setTrackRequested(requestedIdEncodingParamsMap.size > 0);
|
|
14351
|
-
if (getMediaFamily(mediaType) === MediaFamily$1.Video) {
|
|
14356
|
+
if (getMediaFamily$1(mediaType) === MediaFamily$1.Video) {
|
|
14352
14357
|
sendTransceiver.updateSimulcastStreamStates(requestedIdEncodingParamsMap);
|
|
14353
14358
|
}
|
|
14354
14359
|
}
|
|
@@ -14359,7 +14364,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14359
14364
|
this.sendTransceivers.forEach((transceiver, mediaType) => {
|
|
14360
14365
|
var track = transceiver.publishedTrack;
|
|
14361
14366
|
if (track) {
|
|
14362
|
-
if (getMediaFamily(mediaType) === MediaFamily$1.Audio) {
|
|
14367
|
+
if (getMediaFamily$1(mediaType) === MediaFamily$1.Audio) {
|
|
14363
14368
|
this.sendSourceIndication(mediaType, +!track.muted);
|
|
14364
14369
|
} else {
|
|
14365
14370
|
var signaler = this.streamSignalerManager.getEgressStreamSignalerOrThrow(transceiver.mid);
|
|
@@ -14387,7 +14392,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14387
14392
|
logger$4.error("Error parsing datachannel JSON: ".concat(err));
|
|
14388
14393
|
return;
|
|
14389
14394
|
}
|
|
14390
|
-
logger$4.
|
|
14395
|
+
logger$4.debug('DataChannel got msg: ', parsed);
|
|
14391
14396
|
var homerMsg = HomerMsg.fromJson(parsed);
|
|
14392
14397
|
if (!homerMsg) {
|
|
14393
14398
|
logger$4.error("Received invalid datachannel message: ".concat(e));
|
|
@@ -14475,7 +14480,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14475
14480
|
return;
|
|
14476
14481
|
}
|
|
14477
14482
|
if (this.getPublishedTracks().includes(track)) {
|
|
14478
|
-
if (getMediaFamily(mediaType) === MediaFamily$1.Audio) {
|
|
14483
|
+
if (getMediaFamily$1(mediaType) === MediaFamily$1.Audio) {
|
|
14479
14484
|
this.sendSourceIndication(mediaType, +!event.trackState.muted);
|
|
14480
14485
|
} else {
|
|
14481
14486
|
var state = event.trackState.muted ? 'avatar' : 'live';
|
|
@@ -14500,7 +14505,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14500
14505
|
return;
|
|
14501
14506
|
}
|
|
14502
14507
|
if (!event.trackState.muted) {
|
|
14503
|
-
if (getMediaFamily(mediaType) === MediaFamily$1.Audio) {
|
|
14508
|
+
if (getMediaFamily$1(mediaType) === MediaFamily$1.Audio) {
|
|
14504
14509
|
this.sendSourceIndication(mediaType, +event.isPublished);
|
|
14505
14510
|
} else {
|
|
14506
14511
|
var state = event.isPublished ? 'live' : 'no source';
|
|
@@ -14706,9 +14711,9 @@ class MultistreamConnection extends EventEmitter {
|
|
|
14706
14711
|
this.addMid(mediaType);
|
|
14707
14712
|
transceiver.replaceTransceiver(this.pc.addTransceiver(toMediaStreamTrackKind(mediaType), {
|
|
14708
14713
|
direction: 'sendrecv',
|
|
14709
|
-
sendEncodings: getMediaFamily(mediaType) === MediaFamily$1.Video ? this.getVideoEncodingOptions() : undefined
|
|
14714
|
+
sendEncodings: getMediaFamily$1(mediaType) === MediaFamily$1.Video ? this.getVideoEncodingOptions() : undefined
|
|
14710
14715
|
}));
|
|
14711
|
-
transceiver.csi = generateCsi(getMediaFamily(mediaType), mainSceneId);
|
|
14716
|
+
transceiver.csi = generateCsi(getMediaFamily$1(mediaType), mainSceneId);
|
|
14712
14717
|
(_a = this.jmpSessions.get(mediaType)) === null || _a === void 0 ? void 0 : _a.close();
|
|
14713
14718
|
this.createJmpSession(mediaType);
|
|
14714
14719
|
});
|
|
@@ -23737,6 +23742,9 @@ var MediaType;
|
|
|
23737
23742
|
MediaType["AudioMain"] = "AUDIO-MAIN";
|
|
23738
23743
|
MediaType["AudioSlides"] = "AUDIO-SLIDES";
|
|
23739
23744
|
})(MediaType || (MediaType = {}));
|
|
23745
|
+
function getMediaFamily(mediaType) {
|
|
23746
|
+
return [MediaType.VideoMain, MediaType.VideoSlides].includes(mediaType) ? MediaFamily.Video : MediaFamily.Audio;
|
|
23747
|
+
}
|
|
23740
23748
|
var JmpSessionEvents;
|
|
23741
23749
|
(function (JmpSessionEvents) {
|
|
23742
23750
|
JmpSessionEvents["SourceIndication"] = "source-indication";
|
|
@@ -23756,13 +23764,34 @@ class MultistreamRoapMediaConnection extends EventEmitter$4 {
|
|
|
23756
23764
|
_defineProperty(this, "sdpNegotiationStarted", false);
|
|
23757
23765
|
this.debugId = debugId;
|
|
23758
23766
|
this.id = debugId || 'MultistreamRoapMediaConnection';
|
|
23759
|
-
this.configureWcmeLogger();
|
|
23767
|
+
this.configureWcmeLogger(debugId);
|
|
23760
23768
|
this.log('constructor()', "config: ".concat(JSON.stringify(mediaConnectionConfig)));
|
|
23761
23769
|
this.multistreamConnection = this.createMultistreamConnection(mediaConnectionConfig);
|
|
23762
23770
|
this.roap = this.createRoap(debugId);
|
|
23763
23771
|
}
|
|
23764
|
-
configureWcmeLogger() {
|
|
23765
|
-
|
|
23772
|
+
configureWcmeLogger(debugId) {
|
|
23773
|
+
var logger = getLogger();
|
|
23774
|
+
setLogHandler((messages, context) => {
|
|
23775
|
+
var logMessages = Array.from(messages).map(message => typeof message === 'object' ? JSON.stringify(message) : message);
|
|
23776
|
+
logMessages.unshift("".concat(debugId || '', ":[").concat(context.name, "]"));
|
|
23777
|
+
switch (context.level.name) {
|
|
23778
|
+
case 'TRACE':
|
|
23779
|
+
logger.trace(...logMessages);
|
|
23780
|
+
break;
|
|
23781
|
+
case 'DEBUG':
|
|
23782
|
+
logger.debug(...logMessages);
|
|
23783
|
+
break;
|
|
23784
|
+
case 'INFO':
|
|
23785
|
+
logger.info(...logMessages);
|
|
23786
|
+
break;
|
|
23787
|
+
case 'WARN':
|
|
23788
|
+
logger.warn(...logMessages);
|
|
23789
|
+
break;
|
|
23790
|
+
case 'ERROR':
|
|
23791
|
+
logger.error(...logMessages);
|
|
23792
|
+
break;
|
|
23793
|
+
}
|
|
23794
|
+
});
|
|
23766
23795
|
}
|
|
23767
23796
|
log(action, description) {
|
|
23768
23797
|
getLogger().info("".concat(this.id, ":").concat(action, " ").concat(description));
|
|
@@ -23965,4 +23994,4 @@ var Media = {
|
|
|
23965
23994
|
isBrowserSupported
|
|
23966
23995
|
};
|
|
23967
23996
|
|
|
23968
|
-
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 };
|
|
23997
|
+
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,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,SAAS,EACT,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;
|
|
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;IAqC3B,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.35.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/cjs",
|
|
6
6
|
"dist/esm",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@babel/runtime": "^7.18.9",
|
|
48
|
-
"@webex/json-multistream": "1.20.
|
|
48
|
+
"@webex/json-multistream": "1.20.2",
|
|
49
49
|
"@webex/ts-sdp": "1.3.0",
|
|
50
|
-
"@webex/web-client-media-engine": "1.
|
|
50
|
+
"@webex/web-client-media-engine": "1.38.1",
|
|
51
51
|
"detectrtc": "^1.4.1",
|
|
52
52
|
"events": "^3.3.0",
|
|
53
53
|
"typed-emitter": "^2.1.0",
|