@webex/plugin-meetings 3.1.0-next.6 → 3.1.0-next.8
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/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/media/properties.js +102 -57
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/index.js +32 -13
- package/dist/meeting/index.js.map +1 -1
- package/dist/types/media/properties.d.ts +26 -2
- package/dist/webinar/index.js +1 -1
- package/package.json +21 -21
- package/src/media/properties.ts +67 -15
- package/src/meeting/index.ts +9 -1
- package/test/unit/spec/media/properties.ts +145 -140
- package/test/unit/spec/meeting/index.js +14 -2
package/dist/breakouts/index.js
CHANGED
|
@@ -1041,7 +1041,7 @@ var Breakouts = _webexCore.WebexPlugin.extend({
|
|
|
1041
1041
|
this.trigger(_constants.BREAKOUTS.EVENTS.ASK_RETURN_TO_MAIN);
|
|
1042
1042
|
}
|
|
1043
1043
|
},
|
|
1044
|
-
version: "3.1.0-next.
|
|
1044
|
+
version: "3.1.0-next.8"
|
|
1045
1045
|
});
|
|
1046
1046
|
var _default = exports.default = Breakouts;
|
|
1047
1047
|
//# sourceMappingURL=index.js.map
|
|
@@ -373,7 +373,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
|
|
|
373
373
|
throw error;
|
|
374
374
|
});
|
|
375
375
|
},
|
|
376
|
-
version: "3.1.0-next.
|
|
376
|
+
version: "3.1.0-next.8"
|
|
377
377
|
});
|
|
378
378
|
var _default = exports.default = SimultaneousInterpretation;
|
|
379
379
|
//# sourceMappingURL=index.js.map
|
package/dist/media/properties.js
CHANGED
|
@@ -15,6 +15,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/he
|
|
|
15
15
|
var _constants = require("../constants");
|
|
16
16
|
var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
|
|
17
17
|
var _MediaConnectionAwaiter = _interopRequireDefault(require("./MediaConnectionAwaiter"));
|
|
18
|
+
/* eslint-disable class-methods-use-this */
|
|
18
19
|
/**
|
|
19
20
|
* @class MediaProperties
|
|
20
21
|
*/
|
|
@@ -203,85 +204,129 @@ var MediaProperties = exports.default = /*#__PURE__*/function () {
|
|
|
203
204
|
return mediaConnectionAwaiter.waitForMediaConnectionConnected();
|
|
204
205
|
}
|
|
205
206
|
|
|
207
|
+
/**
|
|
208
|
+
* Returns ICE transport information:
|
|
209
|
+
* - selectedCandidatePairChanges - number of times the selected candidate pair was changed, it should be at least 1 for successful connections
|
|
210
|
+
* it will be -1 if browser doesn't supply this information
|
|
211
|
+
* - numTransports - number of transports (should be 1 if we're using bundle)
|
|
212
|
+
*
|
|
213
|
+
* @param {Array<any>} allStatsReports array of RTC stats reports
|
|
214
|
+
* @returns {Object}
|
|
215
|
+
*/
|
|
216
|
+
}, {
|
|
217
|
+
key: "getTransportInfo",
|
|
218
|
+
value: function getTransportInfo(allStatsReports) {
|
|
219
|
+
var transports = allStatsReports.filter(function (report) {
|
|
220
|
+
return report.type === 'transport';
|
|
221
|
+
});
|
|
222
|
+
if (transports.length > 1) {
|
|
223
|
+
_loggerProxy.default.logger.warn("Media:properties#getSelectedCandidatePairChanges --> found more than 1 transport: ".concat(transports.length));
|
|
224
|
+
}
|
|
225
|
+
return {
|
|
226
|
+
selectedCandidatePairChanges: transports.length > 0 && transports[0].selectedCandidatePairChanges !== undefined ? transports[0].selectedCandidatePairChanges : -1,
|
|
227
|
+
numTransports: transports.length
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
|
|
206
231
|
/**
|
|
207
232
|
* Returns the type of a connection that has been established
|
|
233
|
+
* It should be 'UDP' | 'TCP' | 'TURN-TLS' | 'TURN-TCP' | 'TURN-UDP' | 'unknown'
|
|
234
|
+
*
|
|
235
|
+
* If connection was not established, it returns 'unknown'
|
|
236
|
+
*
|
|
237
|
+
* @param {Array<any>} allStatsReports array of RTC stats reports
|
|
238
|
+
* @returns {string}
|
|
239
|
+
*/
|
|
240
|
+
}, {
|
|
241
|
+
key: "getConnectionType",
|
|
242
|
+
value: function getConnectionType(allStatsReports) {
|
|
243
|
+
var successfulCandidatePairs = allStatsReports.filter(function (report) {
|
|
244
|
+
var _report$state;
|
|
245
|
+
return report.type === 'candidate-pair' && ((_report$state = report.state) === null || _report$state === void 0 ? void 0 : _report$state.toLowerCase()) === 'succeeded';
|
|
246
|
+
});
|
|
247
|
+
var foundConnectionType = 'unknown';
|
|
248
|
+
|
|
249
|
+
// all of the successful pairs should have the same connection type, so just return the type for the first one
|
|
250
|
+
successfulCandidatePairs.some(function (pair) {
|
|
251
|
+
var localCandidate = allStatsReports.find(function (report) {
|
|
252
|
+
return report.type === 'local-candidate' && report.id === pair.localCandidateId;
|
|
253
|
+
});
|
|
254
|
+
if (localCandidate === undefined) {
|
|
255
|
+
_loggerProxy.default.logger.warn("Media:properties#getConnectionType --> failed to find local candidate \"".concat(pair.localCandidateId, "\" in getStats() results"));
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
var connectionType;
|
|
259
|
+
if (localCandidate.relayProtocol) {
|
|
260
|
+
connectionType = "TURN-".concat(localCandidate.relayProtocol.toUpperCase());
|
|
261
|
+
} else {
|
|
262
|
+
var _localCandidate$proto;
|
|
263
|
+
connectionType = (_localCandidate$proto = localCandidate.protocol) === null || _localCandidate$proto === void 0 ? void 0 : _localCandidate$proto.toUpperCase(); // it will be UDP or TCP
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
if (connectionType) {
|
|
267
|
+
foundConnectionType = connectionType;
|
|
268
|
+
return true;
|
|
269
|
+
}
|
|
270
|
+
_loggerProxy.default.logger.warn("Media:properties#getConnectionType --> missing localCandidate.protocol, candidateType=".concat(localCandidate.candidateType));
|
|
271
|
+
return false;
|
|
272
|
+
});
|
|
273
|
+
if (foundConnectionType === 'unknown') {
|
|
274
|
+
var candidatePairStates = allStatsReports.filter(function (report) {
|
|
275
|
+
return report.type === 'candidate-pair';
|
|
276
|
+
}).map(function (report) {
|
|
277
|
+
return report.state;
|
|
278
|
+
});
|
|
279
|
+
_loggerProxy.default.logger.warn("Media:properties#getConnectionType --> all candidate pair states: ".concat((0, _stringify.default)(candidatePairStates)));
|
|
280
|
+
}
|
|
281
|
+
return foundConnectionType;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Returns information about current webrtc media connection
|
|
208
286
|
*
|
|
209
|
-
* @returns {Promise<
|
|
287
|
+
* @returns {Promise<Object>}
|
|
210
288
|
*/
|
|
211
289
|
}, {
|
|
212
|
-
key: "
|
|
290
|
+
key: "getCurrentConnectionInfo",
|
|
213
291
|
value: (function () {
|
|
214
|
-
var
|
|
215
|
-
var allStatsReports, statsResult,
|
|
292
|
+
var _getCurrentConnectionInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
293
|
+
var allStatsReports, statsResult, connectionType, _this$getTransportInf, selectedCandidatePairChanges, numTransports;
|
|
216
294
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
217
295
|
while (1) switch (_context.prev = _context.next) {
|
|
218
296
|
case 0:
|
|
219
|
-
_context.next = 2;
|
|
220
|
-
return this.waitForMediaConnectionConnected();
|
|
221
|
-
case 2:
|
|
222
297
|
allStatsReports = [];
|
|
223
|
-
_context.prev =
|
|
224
|
-
_context.next =
|
|
298
|
+
_context.prev = 1;
|
|
299
|
+
_context.next = 4;
|
|
225
300
|
return this.webrtcMediaConnection.getStats();
|
|
226
|
-
case
|
|
301
|
+
case 4:
|
|
227
302
|
statsResult = _context.sent;
|
|
228
303
|
statsResult.forEach(function (report) {
|
|
229
304
|
return allStatsReports.push(report);
|
|
230
305
|
});
|
|
231
|
-
_context.next =
|
|
306
|
+
_context.next = 11;
|
|
232
307
|
break;
|
|
233
|
-
case
|
|
234
|
-
_context.prev =
|
|
235
|
-
_context.t0 = _context["catch"](
|
|
236
|
-
_loggerProxy.default.logger.warn("Media:properties#
|
|
237
|
-
case
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
var localCandidate = allStatsReports.find(function (report) {
|
|
245
|
-
return report.type === 'local-candidate' && report.id === pair.localCandidateId;
|
|
246
|
-
});
|
|
247
|
-
if (localCandidate === undefined) {
|
|
248
|
-
_loggerProxy.default.logger.warn("Media:properties#getCurrentConnectionType --> failed to find local candidate \"".concat(pair.localCandidateId, "\" in getStats() results"));
|
|
249
|
-
return false;
|
|
250
|
-
}
|
|
251
|
-
var connectionType;
|
|
252
|
-
if (localCandidate.relayProtocol) {
|
|
253
|
-
connectionType = "TURN-".concat(localCandidate.relayProtocol.toUpperCase());
|
|
254
|
-
} else {
|
|
255
|
-
var _localCandidate$proto;
|
|
256
|
-
connectionType = (_localCandidate$proto = localCandidate.protocol) === null || _localCandidate$proto === void 0 ? void 0 : _localCandidate$proto.toUpperCase(); // it will be UDP or TCP
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
if (connectionType) {
|
|
260
|
-
foundConnectionType = connectionType;
|
|
261
|
-
return true;
|
|
262
|
-
}
|
|
263
|
-
_loggerProxy.default.logger.warn("Media:properties#getCurrentConnectionType --> missing localCandidate.protocol, candidateType=".concat(localCandidate.candidateType));
|
|
264
|
-
return false;
|
|
308
|
+
case 8:
|
|
309
|
+
_context.prev = 8;
|
|
310
|
+
_context.t0 = _context["catch"](1);
|
|
311
|
+
_loggerProxy.default.logger.warn("Media:properties#getCurrentConnectionInfo --> getStats() failed: ".concat(_context.t0));
|
|
312
|
+
case 11:
|
|
313
|
+
connectionType = this.getConnectionType(allStatsReports);
|
|
314
|
+
_this$getTransportInf = this.getTransportInfo(allStatsReports), selectedCandidatePairChanges = _this$getTransportInf.selectedCandidatePairChanges, numTransports = _this$getTransportInf.numTransports;
|
|
315
|
+
return _context.abrupt("return", {
|
|
316
|
+
connectionType: connectionType,
|
|
317
|
+
selectedCandidatePairChanges: selectedCandidatePairChanges,
|
|
318
|
+
numTransports: numTransports
|
|
265
319
|
});
|
|
266
|
-
|
|
267
|
-
candidatePairStates = allStatsReports.filter(function (report) {
|
|
268
|
-
return report.type === 'candidate-pair';
|
|
269
|
-
}).map(function (report) {
|
|
270
|
-
return report.state;
|
|
271
|
-
});
|
|
272
|
-
_loggerProxy.default.logger.warn("Media:properties#getCurrentConnectionType --> all candidate pair states: ".concat((0, _stringify.default)(candidatePairStates)));
|
|
273
|
-
}
|
|
274
|
-
return _context.abrupt("return", foundConnectionType);
|
|
275
|
-
case 18:
|
|
320
|
+
case 14:
|
|
276
321
|
case "end":
|
|
277
322
|
return _context.stop();
|
|
278
323
|
}
|
|
279
|
-
}, _callee, this, [[
|
|
324
|
+
}, _callee, this, [[1, 8]]);
|
|
280
325
|
}));
|
|
281
|
-
function
|
|
282
|
-
return
|
|
326
|
+
function getCurrentConnectionInfo() {
|
|
327
|
+
return _getCurrentConnectionInfo.apply(this, arguments);
|
|
283
328
|
}
|
|
284
|
-
return
|
|
329
|
+
return getCurrentConnectionInfo;
|
|
285
330
|
}())
|
|
286
331
|
}]);
|
|
287
332
|
return MediaProperties;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_constants","require","_loggerProxy","_interopRequireDefault","_MediaConnectionAwaiter","MediaProperties","exports","default","_classCallCheck2","_defineProperty2","MEETINGS","webrtcMediaConnection","mediaDirection","receiveAudio","receiveVideo","receiveShare","sendAudio","sendVideo","sendShare","videoStream","audioStream","shareVideoStream","shareAudioStream","remoteShareStream","undefined","remoteAudioStream","remoteVideoStream","remoteQualityLevel","QUALITY_LEVELS","HIGH","mediaSettings","videoDeviceId","_createClass2","key","value","getVideoDeviceId","setMediaDirection","setMediaSettings","type","values","setMediaPeerConnection","mediaPeerConnection","setLocalVideoStream","setLocalAudioStream","setLocalShareVideoStream","setLocalShareAudioStream","setRemoteQualityLevel","setRemoteShareStream","setRemoteAudioStream","setRemoteVideoStream","setVideoDeviceId","deviceId","unsetPeerConnection","unsetRemoteMedia","unsetRemoteShareStream","unsetRemoteStreams","hasLocalShareStream","waitForMediaConnectionConnected","mediaConnectionAwaiter","MediaConnectionAwaiter","_getCurrentConnectionType","_asyncToGenerator2","_regenerator","mark","_callee","allStatsReports","statsResult","successfulCandidatePairs","foundConnectionType","candidatePairStates","wrap","_callee$","_context","prev","next","getStats","sent","forEach","report","push","t0","LoggerProxy","logger","warn","concat","filter","_report$state","state","toLowerCase","some","pair","localCandidate","find","id","localCandidateId","connectionType","relayProtocol","toUpperCase","_localCandidate$proto","protocol","candidateType","map","_stringify","abrupt","stop","getCurrentConnectionType","apply","arguments"],"sources":["properties.ts"],"sourcesContent":["import {\n LocalCameraStream,\n LocalMicrophoneStream,\n LocalDisplayStream,\n LocalSystemAudioStream,\n RemoteStream,\n} from '@webex/media-helpers';\n\nimport {MEETINGS, QUALITY_LEVELS} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport MediaConnectionAwaiter from './MediaConnectionAwaiter';\n\nexport type MediaDirection = {\n sendAudio: boolean;\n sendVideo: boolean;\n sendShare: boolean;\n receiveAudio: boolean;\n receiveVideo: boolean;\n receiveShare: boolean;\n};\n\n/**\n * @class MediaProperties\n */\nexport default class MediaProperties {\n audioStream?: LocalMicrophoneStream;\n mediaDirection: MediaDirection;\n mediaSettings: any;\n webrtcMediaConnection: any;\n remoteAudioStream: RemoteStream;\n remoteQualityLevel: any;\n remoteShareStream: RemoteStream;\n remoteVideoStream: RemoteStream;\n shareVideoStream?: LocalDisplayStream;\n shareAudioStream?: LocalSystemAudioStream;\n videoDeviceId: any;\n videoStream?: LocalCameraStream;\n namespace = MEETINGS;\n\n /**\n * @param {Object} [options] -- to auto construct\n * @returns {MediaProperties}\n */\n constructor() {\n this.webrtcMediaConnection = null;\n this.mediaDirection = {\n receiveAudio: false,\n receiveVideo: false,\n receiveShare: false,\n sendAudio: false,\n sendVideo: false,\n sendShare: false,\n };\n this.videoStream = null;\n this.audioStream = null;\n this.shareVideoStream = null;\n this.shareAudioStream = null;\n this.remoteShareStream = undefined;\n this.remoteAudioStream = undefined;\n this.remoteVideoStream = undefined;\n this.remoteQualityLevel = QUALITY_LEVELS.HIGH;\n this.mediaSettings = {};\n this.videoDeviceId = null;\n }\n\n /**\n * Retrieves the preferred video input device\n * @returns {Object|null}\n */\n getVideoDeviceId() {\n return this.videoDeviceId || null;\n }\n\n setMediaDirection(mediaDirection) {\n this.mediaDirection = mediaDirection;\n }\n\n setMediaSettings(type, values) {\n this.mediaSettings[type] = values;\n }\n\n setMediaPeerConnection(mediaPeerConnection) {\n this.webrtcMediaConnection = mediaPeerConnection;\n }\n\n setLocalVideoStream(videoStream?: LocalCameraStream) {\n this.videoStream = videoStream;\n }\n\n setLocalAudioStream(audioStream?: LocalMicrophoneStream) {\n this.audioStream = audioStream;\n }\n\n setLocalShareVideoStream(shareVideoStream?: LocalDisplayStream) {\n this.shareVideoStream = shareVideoStream;\n }\n\n setLocalShareAudioStream(shareAudioStream?: LocalSystemAudioStream) {\n this.shareAudioStream = shareAudioStream;\n }\n\n setRemoteQualityLevel(remoteQualityLevel) {\n this.remoteQualityLevel = remoteQualityLevel;\n }\n\n setRemoteShareStream(remoteShareStream: RemoteStream) {\n this.remoteShareStream = remoteShareStream;\n }\n\n /**\n * Sets the remote audio stream\n * @param {RemoteStream} remoteAudioStream RemoteStream to save\n * @returns {void}\n */\n setRemoteAudioStream(remoteAudioStream: RemoteStream) {\n this.remoteAudioStream = remoteAudioStream;\n }\n\n /**\n * Sets the remote video stream\n * @param {RemoteStream} remoteVideoStream RemoteStream to save\n * @returns {void}\n */\n setRemoteVideoStream(remoteVideoStream: RemoteStream) {\n this.remoteVideoStream = remoteVideoStream;\n }\n\n /**\n * Stores the preferred video input device\n * @param {string} deviceId Preferred video input device\n * @returns {void}\n */\n setVideoDeviceId(deviceId: string) {\n this.videoDeviceId = deviceId;\n }\n\n unsetPeerConnection() {\n this.webrtcMediaConnection = null;\n }\n\n /**\n * Removes both remote audio and video from class instance\n * @returns {void}\n */\n unsetRemoteMedia() {\n this.remoteAudioStream = null;\n this.remoteVideoStream = null;\n }\n\n unsetRemoteShareStream() {\n this.remoteShareStream = null;\n }\n\n /**\n * Unsets all remote streams\n * @returns {void}\n */\n unsetRemoteStreams() {\n this.unsetRemoteMedia();\n this.unsetRemoteShareStream();\n }\n\n /**\n * Returns if we have at least one local share stream or not.\n * @returns {Boolean}\n */\n hasLocalShareStream() {\n return !!(this.shareAudioStream || this.shareVideoStream);\n }\n\n /**\n * Waits for the webrtc media connection to be connected.\n *\n * @returns {Promise<void>}\n */\n waitForMediaConnectionConnected(): Promise<void> {\n const mediaConnectionAwaiter = new MediaConnectionAwaiter({\n webrtcMediaConnection: this.webrtcMediaConnection,\n });\n\n return mediaConnectionAwaiter.waitForMediaConnectionConnected();\n }\n\n /**\n * Returns the type of a connection that has been established\n *\n * @returns {Promise<'UDP' | 'TCP' | 'TURN-TLS' | 'TURN-TCP' | 'TURN-UDP' | 'unknown'>}\n */\n async getCurrentConnectionType() {\n // we can only get the connection type after ICE connection has been established\n await this.waitForMediaConnectionConnected();\n\n const allStatsReports = [];\n\n try {\n const statsResult = await this.webrtcMediaConnection.getStats();\n statsResult.forEach((report) => allStatsReports.push(report));\n } catch (error) {\n LoggerProxy.logger.warn(\n `Media:properties#getCurrentConnectionType --> getStats() failed: ${error}`\n );\n }\n\n const successfulCandidatePairs = allStatsReports.filter(\n (report) => report.type === 'candidate-pair' && report.state?.toLowerCase() === 'succeeded'\n );\n\n let foundConnectionType = 'unknown';\n\n // all of the successful pairs should have the same connection type, so just return the type for the first one\n successfulCandidatePairs.some((pair) => {\n const localCandidate = allStatsReports.find(\n (report) => report.type === 'local-candidate' && report.id === pair.localCandidateId\n );\n\n if (localCandidate === undefined) {\n LoggerProxy.logger.warn(\n `Media:properties#getCurrentConnectionType --> failed to find local candidate \"${pair.localCandidateId}\" in getStats() results`\n );\n\n return false;\n }\n\n let connectionType;\n\n if (localCandidate.relayProtocol) {\n connectionType = `TURN-${localCandidate.relayProtocol.toUpperCase()}`;\n } else {\n connectionType = localCandidate.protocol?.toUpperCase(); // it will be UDP or TCP\n }\n\n if (connectionType) {\n foundConnectionType = connectionType;\n\n return true;\n }\n LoggerProxy.logger.warn(\n `Media:properties#getCurrentConnectionType --> missing localCandidate.protocol, candidateType=${localCandidate.candidateType}`\n );\n\n return false;\n });\n\n if (foundConnectionType === 'unknown') {\n const candidatePairStates = allStatsReports\n .filter((report) => report.type === 'candidate-pair')\n .map((report) => report.state);\n\n LoggerProxy.logger.warn(\n `Media:properties#getCurrentConnectionType --> all candidate pair states: ${JSON.stringify(\n candidatePairStates\n )}`\n );\n }\n\n return foundConnectionType;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAQA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,uBAAA,GAAAD,sBAAA,CAAAF,OAAA;AAWA;AACA;AACA;AAFA,IAGqBI,eAAe,GAAAC,OAAA,CAAAC,OAAA;EAelC;AACF;AACA;AACA;EACE,SAAAF,gBAAA,EAAc;IAAA,IAAAG,gBAAA,CAAAD,OAAA,QAAAF,eAAA;IAAA,IAAAI,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,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}
|
|
1
|
+
{"version":3,"names":["_constants","require","_loggerProxy","_interopRequireDefault","_MediaConnectionAwaiter","MediaProperties","exports","default","_classCallCheck2","_defineProperty2","MEETINGS","webrtcMediaConnection","mediaDirection","receiveAudio","receiveVideo","receiveShare","sendAudio","sendVideo","sendShare","videoStream","audioStream","shareVideoStream","shareAudioStream","remoteShareStream","undefined","remoteAudioStream","remoteVideoStream","remoteQualityLevel","QUALITY_LEVELS","HIGH","mediaSettings","videoDeviceId","_createClass2","key","value","getVideoDeviceId","setMediaDirection","setMediaSettings","type","values","setMediaPeerConnection","mediaPeerConnection","setLocalVideoStream","setLocalAudioStream","setLocalShareVideoStream","setLocalShareAudioStream","setRemoteQualityLevel","setRemoteShareStream","setRemoteAudioStream","setRemoteVideoStream","setVideoDeviceId","deviceId","unsetPeerConnection","unsetRemoteMedia","unsetRemoteShareStream","unsetRemoteStreams","hasLocalShareStream","waitForMediaConnectionConnected","mediaConnectionAwaiter","MediaConnectionAwaiter","getTransportInfo","allStatsReports","transports","filter","report","length","LoggerProxy","logger","warn","concat","selectedCandidatePairChanges","numTransports","getConnectionType","successfulCandidatePairs","_report$state","state","toLowerCase","foundConnectionType","some","pair","localCandidate","find","id","localCandidateId","connectionType","relayProtocol","toUpperCase","_localCandidate$proto","protocol","candidateType","candidatePairStates","map","_stringify","_getCurrentConnectionInfo","_asyncToGenerator2","_regenerator","mark","_callee","statsResult","_this$getTransportInf","wrap","_callee$","_context","prev","next","getStats","sent","forEach","push","t0","abrupt","stop","getCurrentConnectionInfo","apply","arguments"],"sources":["properties.ts"],"sourcesContent":["/* eslint-disable class-methods-use-this */\nimport {\n LocalCameraStream,\n LocalMicrophoneStream,\n LocalDisplayStream,\n LocalSystemAudioStream,\n RemoteStream,\n} from '@webex/media-helpers';\n\nimport {MEETINGS, QUALITY_LEVELS} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport MediaConnectionAwaiter from './MediaConnectionAwaiter';\n\nexport type MediaDirection = {\n sendAudio: boolean;\n sendVideo: boolean;\n sendShare: boolean;\n receiveAudio: boolean;\n receiveVideo: boolean;\n receiveShare: boolean;\n};\n\n/**\n * @class MediaProperties\n */\nexport default class MediaProperties {\n audioStream?: LocalMicrophoneStream;\n mediaDirection: MediaDirection;\n mediaSettings: any;\n webrtcMediaConnection: any;\n remoteAudioStream: RemoteStream;\n remoteQualityLevel: any;\n remoteShareStream: RemoteStream;\n remoteVideoStream: RemoteStream;\n shareVideoStream?: LocalDisplayStream;\n shareAudioStream?: LocalSystemAudioStream;\n videoDeviceId: any;\n videoStream?: LocalCameraStream;\n namespace = MEETINGS;\n\n /**\n * @param {Object} [options] -- to auto construct\n * @returns {MediaProperties}\n */\n constructor() {\n this.webrtcMediaConnection = null;\n this.mediaDirection = {\n receiveAudio: false,\n receiveVideo: false,\n receiveShare: false,\n sendAudio: false,\n sendVideo: false,\n sendShare: false,\n };\n this.videoStream = null;\n this.audioStream = null;\n this.shareVideoStream = null;\n this.shareAudioStream = null;\n this.remoteShareStream = undefined;\n this.remoteAudioStream = undefined;\n this.remoteVideoStream = undefined;\n this.remoteQualityLevel = QUALITY_LEVELS.HIGH;\n this.mediaSettings = {};\n this.videoDeviceId = null;\n }\n\n /**\n * Retrieves the preferred video input device\n * @returns {Object|null}\n */\n getVideoDeviceId() {\n return this.videoDeviceId || null;\n }\n\n setMediaDirection(mediaDirection) {\n this.mediaDirection = mediaDirection;\n }\n\n setMediaSettings(type, values) {\n this.mediaSettings[type] = values;\n }\n\n setMediaPeerConnection(mediaPeerConnection) {\n this.webrtcMediaConnection = mediaPeerConnection;\n }\n\n setLocalVideoStream(videoStream?: LocalCameraStream) {\n this.videoStream = videoStream;\n }\n\n setLocalAudioStream(audioStream?: LocalMicrophoneStream) {\n this.audioStream = audioStream;\n }\n\n setLocalShareVideoStream(shareVideoStream?: LocalDisplayStream) {\n this.shareVideoStream = shareVideoStream;\n }\n\n setLocalShareAudioStream(shareAudioStream?: LocalSystemAudioStream) {\n this.shareAudioStream = shareAudioStream;\n }\n\n setRemoteQualityLevel(remoteQualityLevel) {\n this.remoteQualityLevel = remoteQualityLevel;\n }\n\n setRemoteShareStream(remoteShareStream: RemoteStream) {\n this.remoteShareStream = remoteShareStream;\n }\n\n /**\n * Sets the remote audio stream\n * @param {RemoteStream} remoteAudioStream RemoteStream to save\n * @returns {void}\n */\n setRemoteAudioStream(remoteAudioStream: RemoteStream) {\n this.remoteAudioStream = remoteAudioStream;\n }\n\n /**\n * Sets the remote video stream\n * @param {RemoteStream} remoteVideoStream RemoteStream to save\n * @returns {void}\n */\n setRemoteVideoStream(remoteVideoStream: RemoteStream) {\n this.remoteVideoStream = remoteVideoStream;\n }\n\n /**\n * Stores the preferred video input device\n * @param {string} deviceId Preferred video input device\n * @returns {void}\n */\n setVideoDeviceId(deviceId: string) {\n this.videoDeviceId = deviceId;\n }\n\n unsetPeerConnection() {\n this.webrtcMediaConnection = null;\n }\n\n /**\n * Removes both remote audio and video from class instance\n * @returns {void}\n */\n unsetRemoteMedia() {\n this.remoteAudioStream = null;\n this.remoteVideoStream = null;\n }\n\n unsetRemoteShareStream() {\n this.remoteShareStream = null;\n }\n\n /**\n * Unsets all remote streams\n * @returns {void}\n */\n unsetRemoteStreams() {\n this.unsetRemoteMedia();\n this.unsetRemoteShareStream();\n }\n\n /**\n * Returns if we have at least one local share stream or not.\n * @returns {Boolean}\n */\n hasLocalShareStream() {\n return !!(this.shareAudioStream || this.shareVideoStream);\n }\n\n /**\n * Waits for the webrtc media connection to be connected.\n *\n * @returns {Promise<void>}\n */\n waitForMediaConnectionConnected(): Promise<void> {\n const mediaConnectionAwaiter = new MediaConnectionAwaiter({\n webrtcMediaConnection: this.webrtcMediaConnection,\n });\n\n return mediaConnectionAwaiter.waitForMediaConnectionConnected();\n }\n\n /**\n * Returns ICE transport information:\n * - selectedCandidatePairChanges - number of times the selected candidate pair was changed, it should be at least 1 for successful connections\n * it will be -1 if browser doesn't supply this information\n * - numTransports - number of transports (should be 1 if we're using bundle)\n *\n * @param {Array<any>} allStatsReports array of RTC stats reports\n * @returns {Object}\n */\n private getTransportInfo(allStatsReports: any[]): {\n selectedCandidatePairChanges: number;\n numTransports: number;\n } {\n const transports = allStatsReports.filter((report) => report.type === 'transport');\n\n if (transports.length > 1) {\n LoggerProxy.logger.warn(\n `Media:properties#getSelectedCandidatePairChanges --> found more than 1 transport: ${transports.length}`\n );\n }\n\n return {\n selectedCandidatePairChanges:\n transports.length > 0 && transports[0].selectedCandidatePairChanges !== undefined\n ? transports[0].selectedCandidatePairChanges\n : -1,\n numTransports: transports.length,\n };\n }\n\n /**\n * Returns the type of a connection that has been established\n * It should be 'UDP' | 'TCP' | 'TURN-TLS' | 'TURN-TCP' | 'TURN-UDP' | 'unknown'\n *\n * If connection was not established, it returns 'unknown'\n *\n * @param {Array<any>} allStatsReports array of RTC stats reports\n * @returns {string}\n */\n private getConnectionType(allStatsReports: any[]) {\n const successfulCandidatePairs = allStatsReports.filter(\n (report) => report.type === 'candidate-pair' && report.state?.toLowerCase() === 'succeeded'\n );\n\n let foundConnectionType = 'unknown';\n\n // all of the successful pairs should have the same connection type, so just return the type for the first one\n successfulCandidatePairs.some((pair) => {\n const localCandidate = allStatsReports.find(\n (report) => report.type === 'local-candidate' && report.id === pair.localCandidateId\n );\n\n if (localCandidate === undefined) {\n LoggerProxy.logger.warn(\n `Media:properties#getConnectionType --> failed to find local candidate \"${pair.localCandidateId}\" in getStats() results`\n );\n\n return false;\n }\n\n let connectionType;\n\n if (localCandidate.relayProtocol) {\n connectionType = `TURN-${localCandidate.relayProtocol.toUpperCase()}`;\n } else {\n connectionType = localCandidate.protocol?.toUpperCase(); // it will be UDP or TCP\n }\n\n if (connectionType) {\n foundConnectionType = connectionType;\n\n return true;\n }\n LoggerProxy.logger.warn(\n `Media:properties#getConnectionType --> missing localCandidate.protocol, candidateType=${localCandidate.candidateType}`\n );\n\n return false;\n });\n\n if (foundConnectionType === 'unknown') {\n const candidatePairStates = allStatsReports\n .filter((report) => report.type === 'candidate-pair')\n .map((report) => report.state);\n\n LoggerProxy.logger.warn(\n `Media:properties#getConnectionType --> all candidate pair states: ${JSON.stringify(\n candidatePairStates\n )}`\n );\n }\n\n return foundConnectionType;\n }\n\n /**\n * Returns information about current webrtc media connection\n *\n * @returns {Promise<Object>}\n */\n async getCurrentConnectionInfo(): Promise<{\n connectionType: string;\n selectedCandidatePairChanges: number;\n numTransports: number;\n }> {\n const allStatsReports = [];\n\n try {\n const statsResult = await this.webrtcMediaConnection.getStats();\n statsResult.forEach((report) => allStatsReports.push(report));\n } catch (error) {\n LoggerProxy.logger.warn(\n `Media:properties#getCurrentConnectionInfo --> getStats() failed: ${error}`\n );\n }\n\n const connectionType = this.getConnectionType(allStatsReports);\n const {selectedCandidatePairChanges, numTransports} = this.getTransportInfo(allStatsReports);\n\n return {\n connectionType,\n selectedCandidatePairChanges,\n numTransports,\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AASA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,uBAAA,GAAAD,sBAAA,CAAAF,OAAA;AAXA;AAsBA;AACA;AACA;AAFA,IAGqBI,eAAe,GAAAC,OAAA,CAAAC,OAAA;EAelC;AACF;AACA;AACA;EACE,SAAAF,gBAAA,EAAc;IAAA,IAAAG,gBAAA,CAAAD,OAAA,QAAAF,eAAA;IAAA,IAAAI,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAAAF,OAAA;IAAA,IAAAE,gBAAA,CAA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,EAAE;cAAAyC,QAAA,CAAAC,IAAA;cAAAD,QAAA,CAAAE,IAAA;cAAA,OAGE,IAAI,CAAC7F,qBAAqB,CAAC8F,QAAQ,CAAC,CAAC;YAAA;cAAzDP,WAAW,GAAAI,QAAA,CAAAI,IAAA;cACjBR,WAAW,CAACS,OAAO,CAAC,UAAC3C,MAAM;gBAAA,OAAKH,eAAe,CAAC+C,IAAI,CAAC5C,MAAM,CAAC;cAAA,EAAC;cAACsC,QAAA,CAAAE,IAAA;cAAA;YAAA;cAAAF,QAAA,CAAAC,IAAA;cAAAD,QAAA,CAAAO,EAAA,GAAAP,QAAA;cAE9DpC,oBAAW,CAACC,MAAM,CAACC,IAAI,qEAAAC,MAAA,CAAAiC,QAAA,CAAAO,EAAA,CAEvB,CAAC;YAAC;cAGEzB,cAAc,GAAG,IAAI,CAACZ,iBAAiB,CAACX,eAAe,CAAC;cAAAsC,qBAAA,GACR,IAAI,CAACvC,gBAAgB,CAACC,eAAe,CAAC,EAArFS,4BAA4B,GAAA6B,qBAAA,CAA5B7B,4BAA4B,EAAEC,aAAa,GAAA4B,qBAAA,CAAb5B,aAAa;cAAA,OAAA+B,QAAA,CAAAQ,MAAA,WAE3C;gBACL1B,cAAc,EAAdA,cAAc;gBACdd,4BAA4B,EAA5BA,4BAA4B;gBAC5BC,aAAa,EAAbA;cACF,CAAC;YAAA;YAAA;cAAA,OAAA+B,QAAA,CAAAS,IAAA;UAAA;QAAA,GAAAd,OAAA;MAAA,CACF;MAAA,SAAAe,yBAAA;QAAA,OAAAnB,yBAAA,CAAAoB,KAAA,OAAAC,SAAA;MAAA;MAAA,OAAAF,wBAAA;IAAA;EAAA;EAAA,OAAA3G,eAAA;AAAA"}
|
package/dist/meeting/index.js
CHANGED
|
@@ -6610,7 +6610,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
6610
6610
|
remoteMediaManagerConfig,
|
|
6611
6611
|
bundlePolicy,
|
|
6612
6612
|
_this$remoteMediaMana,
|
|
6613
|
+
_yield$this$mediaProp,
|
|
6613
6614
|
connectionType,
|
|
6615
|
+
selectedCandidatePairChanges,
|
|
6616
|
+
numTransports,
|
|
6614
6617
|
reachabilityStats,
|
|
6615
6618
|
_this$mediaProperties20,
|
|
6616
6619
|
_this$mediaProperties21,
|
|
@@ -6634,6 +6637,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
6634
6637
|
_this$mediaProperties39,
|
|
6635
6638
|
_this$mediaProperties40,
|
|
6636
6639
|
reachabilityMetrics,
|
|
6640
|
+
_yield$this$mediaProp2,
|
|
6641
|
+
_selectedCandidatePairChanges,
|
|
6642
|
+
_numTransports,
|
|
6637
6643
|
_args31 = arguments;
|
|
6638
6644
|
return _regenerator.default.wrap(function _callee31$(_context31) {
|
|
6639
6645
|
while (1) switch (_context31.prev = _context31.next) {
|
|
@@ -6750,17 +6756,22 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
6750
6756
|
return this.enqueueScreenShareFloorRequest();
|
|
6751
6757
|
case 35:
|
|
6752
6758
|
_context31.next = 37;
|
|
6753
|
-
return this.mediaProperties.
|
|
6759
|
+
return this.mediaProperties.getCurrentConnectionInfo();
|
|
6754
6760
|
case 37:
|
|
6755
|
-
|
|
6756
|
-
|
|
6761
|
+
_yield$this$mediaProp = _context31.sent;
|
|
6762
|
+
connectionType = _yield$this$mediaProp.connectionType;
|
|
6763
|
+
selectedCandidatePairChanges = _yield$this$mediaProp.selectedCandidatePairChanges;
|
|
6764
|
+
numTransports = _yield$this$mediaProp.numTransports;
|
|
6765
|
+
_context31.next = 43;
|
|
6757
6766
|
return this.webex.meetings.reachability.getReachabilityMetrics();
|
|
6758
|
-
case
|
|
6767
|
+
case 43:
|
|
6759
6768
|
reachabilityStats = _context31.sent;
|
|
6760
6769
|
_metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_SUCCESS, _objectSpread({
|
|
6761
6770
|
correlation_id: this.correlationId,
|
|
6762
6771
|
locus_id: this.locusUrl.split('/').pop(),
|
|
6763
6772
|
connectionType: connectionType,
|
|
6773
|
+
selectedCandidatePairChanges: selectedCandidatePairChanges,
|
|
6774
|
+
numTransports: numTransports,
|
|
6764
6775
|
isMultistream: this.isMultistream,
|
|
6765
6776
|
retriedWithTurnServer: this.retriedWithTurnServer,
|
|
6766
6777
|
isJoinWithMediaRetry: this.joinWithMediaRetryInfo.isRetry
|
|
@@ -6776,24 +6787,32 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
6776
6787
|
|
|
6777
6788
|
// We can log ReceiveSlot SSRCs only after the SDP exchange, so doing it here:
|
|
6778
6789
|
(_this$remoteMediaMana = this.remoteMediaManager) === null || _this$remoteMediaMana === void 0 ? void 0 : _this$remoteMediaMana.logAllReceiveSlots();
|
|
6779
|
-
_context31.next =
|
|
6790
|
+
_context31.next = 67;
|
|
6780
6791
|
break;
|
|
6781
|
-
case
|
|
6782
|
-
_context31.prev =
|
|
6792
|
+
case 50:
|
|
6793
|
+
_context31.prev = 50;
|
|
6783
6794
|
_context31.t0 = _context31["catch"](19);
|
|
6784
6795
|
_loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _context31.t0);
|
|
6785
6796
|
|
|
6786
6797
|
// @ts-ignore
|
|
6787
|
-
_context31.next =
|
|
6798
|
+
_context31.next = 55;
|
|
6788
6799
|
return this.webex.meetings.reachability.getReachabilityMetrics();
|
|
6789
|
-
case
|
|
6800
|
+
case 55:
|
|
6790
6801
|
reachabilityMetrics = _context31.sent;
|
|
6802
|
+
_context31.next = 58;
|
|
6803
|
+
return this.mediaProperties.getCurrentConnectionInfo();
|
|
6804
|
+
case 58:
|
|
6805
|
+
_yield$this$mediaProp2 = _context31.sent;
|
|
6806
|
+
_selectedCandidatePairChanges = _yield$this$mediaProp2.selectedCandidatePairChanges;
|
|
6807
|
+
_numTransports = _yield$this$mediaProp2.numTransports;
|
|
6791
6808
|
_metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_FAILURE, _objectSpread({
|
|
6792
6809
|
correlation_id: this.correlationId,
|
|
6793
6810
|
locus_id: this.locusUrl.split('/').pop(),
|
|
6794
6811
|
reason: _context31.t0.message,
|
|
6795
6812
|
stack: _context31.t0.stack,
|
|
6796
6813
|
code: _context31.t0.code,
|
|
6814
|
+
selectedCandidatePairChanges: _selectedCandidatePairChanges,
|
|
6815
|
+
numTransports: _numTransports,
|
|
6797
6816
|
turnDiscoverySkippedReason: this.turnDiscoverySkippedReason,
|
|
6798
6817
|
turnServerUsed: this.turnServerUsed,
|
|
6799
6818
|
retriedWithTurnServer: this.retriedWithTurnServer,
|
|
@@ -6803,9 +6822,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
6803
6822
|
connectionState: ((_this$mediaProperties27 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties27 === void 0 ? void 0 : (_this$mediaProperties28 = _this$mediaProperties27.multistreamConnection) === null || _this$mediaProperties28 === void 0 ? void 0 : (_this$mediaProperties29 = _this$mediaProperties28.pc) === null || _this$mediaProperties29 === void 0 ? void 0 : (_this$mediaProperties30 = _this$mediaProperties29.pc) === null || _this$mediaProperties30 === void 0 ? void 0 : _this$mediaProperties30.connectionState) || ((_this$mediaProperties31 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties31 === void 0 ? void 0 : (_this$mediaProperties32 = _this$mediaProperties31.mediaConnection) === null || _this$mediaProperties32 === void 0 ? void 0 : (_this$mediaProperties33 = _this$mediaProperties32.pc) === null || _this$mediaProperties33 === void 0 ? void 0 : _this$mediaProperties33.connectionState) || 'unknown',
|
|
6804
6823
|
iceConnectionState: ((_this$mediaProperties34 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties34 === void 0 ? void 0 : (_this$mediaProperties35 = _this$mediaProperties34.multistreamConnection) === null || _this$mediaProperties35 === void 0 ? void 0 : (_this$mediaProperties36 = _this$mediaProperties35.pc) === null || _this$mediaProperties36 === void 0 ? void 0 : (_this$mediaProperties37 = _this$mediaProperties36.pc) === null || _this$mediaProperties37 === void 0 ? void 0 : _this$mediaProperties37.iceConnectionState) || ((_this$mediaProperties38 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties38 === void 0 ? void 0 : (_this$mediaProperties39 = _this$mediaProperties38.mediaConnection) === null || _this$mediaProperties39 === void 0 ? void 0 : (_this$mediaProperties40 = _this$mediaProperties39.pc) === null || _this$mediaProperties40 === void 0 ? void 0 : _this$mediaProperties40.iceConnectionState) || 'unknown'
|
|
6805
6824
|
}, reachabilityMetrics));
|
|
6806
|
-
_context31.next =
|
|
6825
|
+
_context31.next = 64;
|
|
6807
6826
|
return this.cleanUpOnAddMediaFailure();
|
|
6808
|
-
case
|
|
6827
|
+
case 64:
|
|
6809
6828
|
// Upload logs on error while adding media
|
|
6810
6829
|
_triggerProxy.default.trigger(this, {
|
|
6811
6830
|
file: 'meeting/index',
|
|
@@ -6817,11 +6836,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
6817
6836
|
});
|
|
6818
6837
|
}
|
|
6819
6838
|
throw _context31.t0;
|
|
6820
|
-
case
|
|
6839
|
+
case 67:
|
|
6821
6840
|
case "end":
|
|
6822
6841
|
return _context31.stop();
|
|
6823
6842
|
}
|
|
6824
|
-
}, _callee31, this, [[19,
|
|
6843
|
+
}, _callee31, this, [[19, 50]]);
|
|
6825
6844
|
}));
|
|
6826
6845
|
function addMedia() {
|
|
6827
6846
|
return _addMedia.apply(this, arguments);
|