@bigbinary/neeto-media-recorder 2.7.32 → 2.7.33
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/core.js +550 -178
- package/core.js.map +1 -1
- package/package.json +1 -1
package/core.js
CHANGED
|
@@ -991,6 +991,7 @@ var _pendingS3ChunkUploads = /*#__PURE__*/new WeakMap();
|
|
|
991
991
|
var _completeUploadPromise = /*#__PURE__*/new WeakMap();
|
|
992
992
|
var _failedUpload = /*#__PURE__*/new WeakMap();
|
|
993
993
|
var _uploadProgress = /*#__PURE__*/new WeakMap();
|
|
994
|
+
var _lastLoggedOverallPercent = /*#__PURE__*/new WeakMap();
|
|
994
995
|
var _status = /*#__PURE__*/new WeakMap();
|
|
995
996
|
var _id = /*#__PURE__*/new WeakMap();
|
|
996
997
|
var _logger$1 = /*#__PURE__*/new WeakMap();
|
|
@@ -998,6 +999,7 @@ var _mimeType$1 = /*#__PURE__*/new WeakMap();
|
|
|
998
999
|
var _status2 = /*#__PURE__*/new WeakMap();
|
|
999
1000
|
var _fireCallbacks$1 = /*#__PURE__*/new WeakMap();
|
|
1000
1001
|
var _handleChunkUploadError = /*#__PURE__*/new WeakMap();
|
|
1002
|
+
var _serializeUploadError = /*#__PURE__*/new WeakMap();
|
|
1001
1003
|
var _uploadChunkToS = /*#__PURE__*/new WeakMap();
|
|
1002
1004
|
var _getCurrentUnUploadedBlob = /*#__PURE__*/new WeakMap();
|
|
1003
1005
|
var _isRecordingNotSet = /*#__PURE__*/new WeakMap();
|
|
@@ -1058,6 +1060,10 @@ var MultipartS3Uploader = /*#__PURE__*/function () {
|
|
|
1058
1060
|
writable: true,
|
|
1059
1061
|
value: {}
|
|
1060
1062
|
});
|
|
1063
|
+
_classPrivateFieldInitSpec$1(this, _lastLoggedOverallPercent, {
|
|
1064
|
+
writable: true,
|
|
1065
|
+
value: -1
|
|
1066
|
+
});
|
|
1061
1067
|
_classPrivateFieldInitSpec$1(this, _status, {
|
|
1062
1068
|
writable: true,
|
|
1063
1069
|
value: ""
|
|
@@ -1078,6 +1084,10 @@ var MultipartS3Uploader = /*#__PURE__*/function () {
|
|
|
1078
1084
|
return _classPrivateFieldSet(_this, _mimeType$1, mimeType);
|
|
1079
1085
|
});
|
|
1080
1086
|
_defineProperty(this, "setRecording", function (recordingId, uploadId) {
|
|
1087
|
+
_classPrivateFieldGet(_this, _logger$1).info("setRecording", {
|
|
1088
|
+
recordingId: recordingId,
|
|
1089
|
+
uploadId: uploadId
|
|
1090
|
+
});
|
|
1081
1091
|
_classPrivateFieldSet(_this, _recordingId, recordingId);
|
|
1082
1092
|
_classPrivateFieldSet(_this, _uploadId, uploadId);
|
|
1083
1093
|
_classPrivateFieldSet(_this, _abortController, new AbortController());
|
|
@@ -1086,9 +1096,22 @@ var MultipartS3Uploader = /*#__PURE__*/function () {
|
|
|
1086
1096
|
if (data.size > 0) {
|
|
1087
1097
|
_classPrivateFieldGet(_this, _unUploadedChunks).push(data);
|
|
1088
1098
|
}
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1099
|
+
var unUploadedBytes = _classPrivateFieldGet(_this, _getCurrentUnUploadedBlob).call(_this).size;
|
|
1100
|
+
_classPrivateFieldGet(_this, _logger$1).info("push -> chunk buffered", {
|
|
1101
|
+
chunkBytes: data === null || data === void 0 ? void 0 : data.size,
|
|
1102
|
+
chunkType: data === null || data === void 0 ? void 0 : data.type,
|
|
1103
|
+
bufferedChunks: _classPrivateFieldGet(_this, _unUploadedChunks).length,
|
|
1104
|
+
bufferedBytes: unUploadedBytes,
|
|
1105
|
+
bufferedMB: Number((unUploadedBytes / 1024 / 1024).toFixed(2)),
|
|
1106
|
+
threshold: _this.MIN_UPLOAD_CHUNK_SIZE,
|
|
1107
|
+
recordingId: _classPrivateFieldGet(_this, _recordingId),
|
|
1108
|
+
uploadId: _classPrivateFieldGet(_this, _uploadId)
|
|
1109
|
+
});
|
|
1110
|
+
if (_classPrivateFieldGet(_this, _isRecordingNotSet)) {
|
|
1111
|
+
_classPrivateFieldGet(_this, _logger$1).warn("push -> recording not yet set, holding chunk in buffer");
|
|
1112
|
+
return;
|
|
1113
|
+
}
|
|
1114
|
+
if (unUploadedBytes > _this.MIN_UPLOAD_CHUNK_SIZE) {
|
|
1092
1115
|
var uploadChunkToS3Promise = _classPrivateFieldGet(_this, _uploadChunkToS).call(_this, _classPrivateFieldGet(_this, _unUploadedChunks));
|
|
1093
1116
|
_classPrivateFieldGet(_this, _pendingS3ChunkUploads).push(uploadChunkToS3Promise);
|
|
1094
1117
|
_classPrivateFieldSet(_this, _unUploadedChunks, []);
|
|
@@ -1111,22 +1134,36 @@ var MultipartS3Uploader = /*#__PURE__*/function () {
|
|
|
1111
1134
|
});
|
|
1112
1135
|
_defineProperty(this, "completeUpload", /*#__PURE__*/function () {
|
|
1113
1136
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(sessionLogs) {
|
|
1114
|
-
var uploadChunkToS3Promise, resolvedS3PartUploadPromises, parts;
|
|
1137
|
+
var completeStartedAt, lastChunkBytes, uploadChunkToS3Promise, resolvedS3PartUploadPromises, parts, notifyStartedAt;
|
|
1115
1138
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
1116
1139
|
while (1) switch (_context.prev = _context.next) {
|
|
1117
1140
|
case 0:
|
|
1118
|
-
|
|
1141
|
+
completeStartedAt = Date.now();
|
|
1142
|
+
_classPrivateFieldGet(_this, _logger$1).info("completeUpload -> begin", {
|
|
1143
|
+
recordingId: _classPrivateFieldGet(_this, _recordingId),
|
|
1144
|
+
uploadId: _classPrivateFieldGet(_this, _uploadId),
|
|
1145
|
+
pendingChunks: _classPrivateFieldGet(_this, _pendingS3ChunkUploads).length,
|
|
1146
|
+
bufferedBytes: _classPrivateFieldGet(_this, _getCurrentUnUploadedBlob).call(_this).size,
|
|
1147
|
+
totalPartsStarted: _classPrivateFieldGet(_this, _partNumber) - 1
|
|
1148
|
+
});
|
|
1149
|
+
_context.prev = 2;
|
|
1119
1150
|
_classPrivateFieldSet(_this, _status2, UPLOAD_STATUS.uploading);
|
|
1120
1151
|
if (!_classPrivateFieldGet(_this, _isRecordingNotSet)) {
|
|
1121
|
-
_context.next =
|
|
1152
|
+
_context.next = 7;
|
|
1122
1153
|
break;
|
|
1123
1154
|
}
|
|
1124
|
-
_classPrivateFieldGet(_this, _logger$1).error("completeUpload -> not initialized"
|
|
1155
|
+
_classPrivateFieldGet(_this, _logger$1).error("completeUpload -> not initialized", {
|
|
1156
|
+
recordingId: _classPrivateFieldGet(_this, _recordingId),
|
|
1157
|
+
uploadId: _classPrivateFieldGet(_this, _uploadId)
|
|
1158
|
+
});
|
|
1125
1159
|
return _context.abrupt("return");
|
|
1126
|
-
case
|
|
1160
|
+
case 7:
|
|
1127
1161
|
// Upload last chunk; only if last chunk has data
|
|
1128
|
-
|
|
1129
|
-
|
|
1162
|
+
lastChunkBytes = _classPrivateFieldGet(_this, _getCurrentUnUploadedBlob).call(_this).size;
|
|
1163
|
+
if (lastChunkBytes > 0) {
|
|
1164
|
+
_classPrivateFieldGet(_this, _logger$1).info("completeUpload -> uploading final buffered chunk", {
|
|
1165
|
+
bytes: lastChunkBytes
|
|
1166
|
+
});
|
|
1130
1167
|
uploadChunkToS3Promise = _classPrivateFieldGet(_this, _uploadChunkToS).call(_this, _classPrivateFieldGet(_this, _unUploadedChunks));
|
|
1131
1168
|
_classPrivateFieldGet(_this, _pendingS3ChunkUploads).push(uploadChunkToS3Promise);
|
|
1132
1169
|
}
|
|
@@ -1139,32 +1176,41 @@ var MultipartS3Uploader = /*#__PURE__*/function () {
|
|
|
1139
1176
|
* adding the new presignedUrl part upload to s3PartUploadPromises.
|
|
1140
1177
|
* This results in incorrect partNumbers.
|
|
1141
1178
|
*/
|
|
1142
|
-
_classPrivateFieldGet(_this, _logger$1).info("completeUpload ->
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
case 9:
|
|
1146
|
-
_classPrivateFieldGet(_this, _logger$1).info("completeUpload -> finishing part uploads...");
|
|
1179
|
+
_classPrivateFieldGet(_this, _logger$1).info("completeUpload -> awaiting pending chunks", {
|
|
1180
|
+
pendingS3ChunkUploads: _classPrivateFieldGet(_this, _pendingS3ChunkUploads).length
|
|
1181
|
+
});
|
|
1147
1182
|
_context.next = 12;
|
|
1148
|
-
return Promise.all(_classPrivateFieldGet(_this,
|
|
1183
|
+
return Promise.all(_classPrivateFieldGet(_this, _pendingS3ChunkUploads));
|
|
1149
1184
|
case 12:
|
|
1185
|
+
_classPrivateFieldGet(_this, _logger$1).info("completeUpload -> awaiting part uploads", {
|
|
1186
|
+
s3PartUploadPromises: _classPrivateFieldGet(_this, _s3PartUploadPromises).length
|
|
1187
|
+
});
|
|
1188
|
+
_context.next = 15;
|
|
1189
|
+
return Promise.all(_classPrivateFieldGet(_this, _s3PartUploadPromises));
|
|
1190
|
+
case 15:
|
|
1150
1191
|
resolvedS3PartUploadPromises = _context.sent;
|
|
1151
1192
|
if (!isNotEmpty(_classPrivateFieldGet(_this, _failedUpload))) {
|
|
1152
|
-
_context.next =
|
|
1193
|
+
_context.next = 21;
|
|
1153
1194
|
break;
|
|
1154
1195
|
}
|
|
1155
|
-
_classPrivateFieldGet(_this, _logger$1).
|
|
1196
|
+
_classPrivateFieldGet(_this, _logger$1).error("completeUpload -> failed parts present, aborting completion", {
|
|
1197
|
+
failedPartNumbers: _classPrivateFieldGet(_this, _failedUpload)
|
|
1198
|
+
});
|
|
1156
1199
|
_classPrivateFieldSet(_this, _status2, UPLOAD_STATUS.error);
|
|
1157
1200
|
_classPrivateFieldGet(_this, _fireCallbacks$1).call(_this, UPLOAD_EVENT.onError);
|
|
1158
1201
|
return _context.abrupt("return");
|
|
1159
|
-
case
|
|
1202
|
+
case 21:
|
|
1160
1203
|
if (!(resolvedS3PartUploadPromises.length === 0)) {
|
|
1161
|
-
_context.next =
|
|
1204
|
+
_context.next = 25;
|
|
1162
1205
|
break;
|
|
1163
1206
|
}
|
|
1164
|
-
_classPrivateFieldGet(_this, _logger$1).
|
|
1207
|
+
_classPrivateFieldGet(_this, _logger$1).warn("completeUpload -> no parts uploaded", {
|
|
1208
|
+
recordingId: _classPrivateFieldGet(_this, _recordingId),
|
|
1209
|
+
uploadId: _classPrivateFieldGet(_this, _uploadId)
|
|
1210
|
+
});
|
|
1165
1211
|
_classPrivateFieldSet(_this, _status2, UPLOAD_STATUS.insufficient_data);
|
|
1166
1212
|
return _context.abrupt("return");
|
|
1167
|
-
case
|
|
1213
|
+
case 25:
|
|
1168
1214
|
parts = resolvedS3PartUploadPromises.filter(isNotCancelledRequest).map(function (resolvedResponse) {
|
|
1169
1215
|
return {
|
|
1170
1216
|
etag: resolvedResponse.headers.etag,
|
|
@@ -1173,42 +1219,54 @@ var MultipartS3Uploader = /*#__PURE__*/function () {
|
|
|
1173
1219
|
}).toSorted(function (a, b) {
|
|
1174
1220
|
return Number(a.partNumber) - Number(b.partNumber);
|
|
1175
1221
|
});
|
|
1176
|
-
_classPrivateFieldGet(_this, _logger$1).info("completeUpload ->
|
|
1222
|
+
_classPrivateFieldGet(_this, _logger$1).info("completeUpload -> notifying server", {
|
|
1223
|
+
partCount: parts.length,
|
|
1224
|
+
parts: parts
|
|
1225
|
+
});
|
|
1226
|
+
notifyStartedAt = Date.now();
|
|
1177
1227
|
_classPrivateFieldSet(_this, _completeUploadPromise, _this.completeUploadNotifyServer(parts, sessionLogs));
|
|
1178
|
-
|
|
1179
|
-
_context.next = 28;
|
|
1228
|
+
_context.next = 31;
|
|
1180
1229
|
return _classPrivateFieldGet(_this, _completeUploadPromise);
|
|
1181
|
-
case
|
|
1182
|
-
_classPrivateFieldGet(_this, _logger$1).info("completeUpload -> upload
|
|
1230
|
+
case 31:
|
|
1231
|
+
_classPrivateFieldGet(_this, _logger$1).info("completeUpload -> server notified, upload finalized", {
|
|
1232
|
+
notifyDurationMs: Date.now() - notifyStartedAt,
|
|
1233
|
+
totalDurationMs: Date.now() - completeStartedAt
|
|
1234
|
+
});
|
|
1183
1235
|
if (!(_this.status === UPLOAD_STATUS.aborting)) {
|
|
1184
|
-
_context.next =
|
|
1236
|
+
_context.next = 35;
|
|
1185
1237
|
break;
|
|
1186
1238
|
}
|
|
1187
|
-
_classPrivateFieldGet(_this, _logger$1).
|
|
1239
|
+
_classPrivateFieldGet(_this, _logger$1).warn("completeUpload -> finished but state was set to aborting");
|
|
1188
1240
|
return _context.abrupt("return");
|
|
1189
|
-
case
|
|
1241
|
+
case 35:
|
|
1190
1242
|
_classPrivateFieldSet(_this, _status2, UPLOAD_STATUS.completed);
|
|
1191
1243
|
_classPrivateFieldGet(_this, _fireCallbacks$1).call(_this, UPLOAD_EVENT.onComplete);
|
|
1192
|
-
_context.next =
|
|
1244
|
+
_context.next = 42;
|
|
1193
1245
|
break;
|
|
1194
|
-
case
|
|
1195
|
-
_context.prev =
|
|
1196
|
-
_context.t0 = _context["catch"](
|
|
1246
|
+
case 39:
|
|
1247
|
+
_context.prev = 39;
|
|
1248
|
+
_context.t0 = _context["catch"](2);
|
|
1197
1249
|
// ignore if aborted
|
|
1198
1250
|
if (!axios.isCancel(_context.t0)) {
|
|
1199
1251
|
_classPrivateFieldSet(_this, _status2, UPLOAD_STATUS.error);
|
|
1200
1252
|
_classPrivateFieldGet(_this, _fireCallbacks$1).call(_this, UPLOAD_EVENT.onError);
|
|
1201
|
-
_classPrivateFieldGet(_this, _logger$1).error(_context.t0)
|
|
1253
|
+
_classPrivateFieldGet(_this, _logger$1).error("completeUpload -> error", _objectSpread$2(_objectSpread$2({}, _classPrivateFieldGet(_this, _serializeUploadError).call(_this, _context.t0)), {}, {
|
|
1254
|
+
totalDurationMs: Date.now() - completeStartedAt,
|
|
1255
|
+
recordingId: _classPrivateFieldGet(_this, _recordingId),
|
|
1256
|
+
uploadId: _classPrivateFieldGet(_this, _uploadId)
|
|
1257
|
+
}));
|
|
1258
|
+
} else {
|
|
1259
|
+
_classPrivateFieldGet(_this, _logger$1).info("completeUpload -> request cancelled (expected)");
|
|
1202
1260
|
}
|
|
1203
|
-
case 39:
|
|
1204
|
-
_context.prev = 39;
|
|
1205
|
-
_classPrivateFieldSet(_this, _completeUploadPromise, null);
|
|
1206
|
-
return _context.finish(39);
|
|
1207
1261
|
case 42:
|
|
1262
|
+
_context.prev = 42;
|
|
1263
|
+
_classPrivateFieldSet(_this, _completeUploadPromise, null);
|
|
1264
|
+
return _context.finish(42);
|
|
1265
|
+
case 45:
|
|
1208
1266
|
case "end":
|
|
1209
1267
|
return _context.stop();
|
|
1210
1268
|
}
|
|
1211
|
-
}, _callee, null, [[
|
|
1269
|
+
}, _callee, null, [[2, 39, 42, 45]]);
|
|
1212
1270
|
}));
|
|
1213
1271
|
return function (_x) {
|
|
1214
1272
|
return _ref.apply(this, arguments);
|
|
@@ -1217,6 +1275,7 @@ var MultipartS3Uploader = /*#__PURE__*/function () {
|
|
|
1217
1275
|
_defineProperty(this, "abortUpload", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
1218
1276
|
var forceAbort,
|
|
1219
1277
|
sessionLogs,
|
|
1278
|
+
abortStartedAt,
|
|
1220
1279
|
recordingId,
|
|
1221
1280
|
uploadId,
|
|
1222
1281
|
_args2 = arguments;
|
|
@@ -1225,30 +1284,43 @@ var MultipartS3Uploader = /*#__PURE__*/function () {
|
|
|
1225
1284
|
case 0:
|
|
1226
1285
|
forceAbort = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : false;
|
|
1227
1286
|
sessionLogs = _args2.length > 1 ? _args2[1] : undefined;
|
|
1228
|
-
|
|
1287
|
+
abortStartedAt = Date.now();
|
|
1288
|
+
_context2.prev = 3;
|
|
1229
1289
|
if (!(_this.status === UPLOAD_STATUS.aborting && !forceAbort)) {
|
|
1230
|
-
_context2.next =
|
|
1290
|
+
_context2.next = 7;
|
|
1231
1291
|
break;
|
|
1232
1292
|
}
|
|
1233
|
-
_classPrivateFieldGet(_this, _logger$1).info("abortUpload -> already aborting"
|
|
1293
|
+
_classPrivateFieldGet(_this, _logger$1).info("abortUpload -> already aborting", {
|
|
1294
|
+
forceAbort: forceAbort
|
|
1295
|
+
});
|
|
1234
1296
|
return _context2.abrupt("return");
|
|
1235
|
-
case
|
|
1297
|
+
case 7:
|
|
1236
1298
|
_classPrivateFieldSet(_this, _status2, UPLOAD_STATUS.aborting);
|
|
1237
1299
|
if (!_classPrivateFieldGet(_this, _isRecordingNotSet)) {
|
|
1238
|
-
_context2.next =
|
|
1300
|
+
_context2.next = 11;
|
|
1239
1301
|
break;
|
|
1240
1302
|
}
|
|
1241
1303
|
_classPrivateFieldGet(_this, _logger$1).info("abortUpload -> not initialized");
|
|
1242
1304
|
return _context2.abrupt("return");
|
|
1243
|
-
case
|
|
1305
|
+
case 11:
|
|
1244
1306
|
recordingId = _classPrivateFieldGet(_this, _recordingId);
|
|
1245
1307
|
uploadId = _classPrivateFieldGet(_this, _uploadId);
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1308
|
+
_classPrivateFieldGet(_this, _logger$1).info("abortUpload -> begin", {
|
|
1309
|
+
recordingId: recordingId,
|
|
1310
|
+
uploadId: uploadId,
|
|
1311
|
+
forceAbort: forceAbort,
|
|
1312
|
+
partsStarted: _classPrivateFieldGet(_this, _partNumber) - 1,
|
|
1313
|
+
pendingS3ChunkUploads: _classPrivateFieldGet(_this, _pendingS3ChunkUploads).length
|
|
1314
|
+
});
|
|
1315
|
+
|
|
1316
|
+
// Don't let a rejected completeUpload stop us from issuing the abort API
|
|
1317
|
+
// call below — we still need to release the upload server-side.
|
|
1318
|
+
// eslint-disable-next-line promise/prefer-await-to-then
|
|
1319
|
+
_context2.next = 16;
|
|
1320
|
+
return Promise.resolve(_classPrivateFieldGet(_this, _completeUploadPromise))["catch"](function () {});
|
|
1321
|
+
case 16:
|
|
1249
1322
|
_classPrivateFieldGet(_this, _abortController).abort();
|
|
1250
|
-
|
|
1251
|
-
_context2.next = 18;
|
|
1323
|
+
_context2.next = 19;
|
|
1252
1324
|
return abortUploadApi.create({
|
|
1253
1325
|
recordingId: recordingId,
|
|
1254
1326
|
payload: {
|
|
@@ -1257,25 +1329,29 @@ var MultipartS3Uploader = /*#__PURE__*/function () {
|
|
|
1257
1329
|
logs: sessionLogs
|
|
1258
1330
|
}
|
|
1259
1331
|
});
|
|
1260
|
-
case
|
|
1261
|
-
_classPrivateFieldGet(_this, _logger$1).info("abortUpload ->
|
|
1332
|
+
case 19:
|
|
1333
|
+
_classPrivateFieldGet(_this, _logger$1).info("abortUpload -> success", {
|
|
1334
|
+
durationMs: Date.now() - abortStartedAt
|
|
1335
|
+
});
|
|
1262
1336
|
_classPrivateFieldGet(_this, _fireCallbacks$1).call(_this, UPLOAD_EVENT.onAbort);
|
|
1263
1337
|
_classPrivateFieldSet(_this, _unUploadedChunks, []);
|
|
1264
1338
|
_classPrivateFieldSet(_this, _partNumber, 1);
|
|
1265
1339
|
_classPrivateFieldSet(_this, _s3PartUploadPromises, []);
|
|
1266
1340
|
_classPrivateFieldSet(_this, _status2, "");
|
|
1267
1341
|
_classPrivateFieldSet(_this, _abortController, null);
|
|
1268
|
-
_context2.next =
|
|
1342
|
+
_context2.next = 31;
|
|
1269
1343
|
break;
|
|
1270
|
-
case
|
|
1271
|
-
_context2.prev =
|
|
1272
|
-
_context2.t0 = _context2["catch"](
|
|
1273
|
-
_classPrivateFieldGet(_this, _logger$1).error("abortUpload ->
|
|
1274
|
-
|
|
1344
|
+
case 28:
|
|
1345
|
+
_context2.prev = 28;
|
|
1346
|
+
_context2.t0 = _context2["catch"](3);
|
|
1347
|
+
_classPrivateFieldGet(_this, _logger$1).error("abortUpload -> failed", _objectSpread$2(_objectSpread$2({}, _classPrivateFieldGet(_this, _serializeUploadError).call(_this, _context2.t0)), {}, {
|
|
1348
|
+
durationMs: Date.now() - abortStartedAt
|
|
1349
|
+
}));
|
|
1350
|
+
case 31:
|
|
1275
1351
|
case "end":
|
|
1276
1352
|
return _context2.stop();
|
|
1277
1353
|
}
|
|
1278
|
-
}, _callee2, null, [[
|
|
1354
|
+
}, _callee2, null, [[3, 28]]);
|
|
1279
1355
|
})));
|
|
1280
1356
|
_defineProperty(this, "resetState", function () {
|
|
1281
1357
|
_classPrivateFieldSet(_this, _recordingId, "");
|
|
@@ -1287,6 +1363,7 @@ var MultipartS3Uploader = /*#__PURE__*/function () {
|
|
|
1287
1363
|
_classPrivateFieldSet(_this, _callbacks$1, {});
|
|
1288
1364
|
_classPrivateFieldSet(_this, _failedUpload, []);
|
|
1289
1365
|
_classPrivateFieldSet(_this, _uploadProgress, {});
|
|
1366
|
+
_classPrivateFieldSet(_this, _lastLoggedOverallPercent, -1);
|
|
1290
1367
|
_classPrivateFieldSet(_this, _status2, "");
|
|
1291
1368
|
});
|
|
1292
1369
|
_defineProperty(this, "addCallback", function (event, callback) {
|
|
@@ -1313,9 +1390,21 @@ var MultipartS3Uploader = /*#__PURE__*/function () {
|
|
|
1313
1390
|
_classPrivateFieldInitSpec$1(this, _handleChunkUploadError, {
|
|
1314
1391
|
writable: true,
|
|
1315
1392
|
value: function value(error, partNumber) {
|
|
1393
|
+
var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1316
1394
|
// ignore if aborted
|
|
1317
|
-
if (axios.isCancel(error))
|
|
1318
|
-
|
|
1395
|
+
if (axios.isCancel(error)) {
|
|
1396
|
+
_classPrivateFieldGet(_this, _logger$1).info("upload chunk -> request cancelled (expected)", {
|
|
1397
|
+
partNumber: partNumber
|
|
1398
|
+
});
|
|
1399
|
+
return;
|
|
1400
|
+
}
|
|
1401
|
+
_classPrivateFieldGet(_this, _logger$1).error("upload chunk -> failed", _objectSpread$2(_objectSpread$2(_objectSpread$2({
|
|
1402
|
+
partNumber: partNumber
|
|
1403
|
+
}, _classPrivateFieldGet(_this, _serializeUploadError).call(_this, error)), context), {}, {
|
|
1404
|
+
uploadStatus: _this.status,
|
|
1405
|
+
recordingId: _classPrivateFieldGet(_this, _recordingId),
|
|
1406
|
+
uploadId: _classPrivateFieldGet(_this, _uploadId)
|
|
1407
|
+
}));
|
|
1319
1408
|
if (_this.status === UPLOAD_STATUS.uploading) {
|
|
1320
1409
|
_classPrivateFieldSet(_this, _status2, UPLOAD_STATUS.error);
|
|
1321
1410
|
_classPrivateFieldGet(_this, _fireCallbacks$1).call(_this, UPLOAD_EVENT.onError);
|
|
@@ -1324,6 +1413,24 @@ var MultipartS3Uploader = /*#__PURE__*/function () {
|
|
|
1324
1413
|
}
|
|
1325
1414
|
}
|
|
1326
1415
|
});
|
|
1416
|
+
_classPrivateFieldInitSpec$1(this, _serializeUploadError, {
|
|
1417
|
+
writable: true,
|
|
1418
|
+
value: function value(error) {
|
|
1419
|
+
var _error$response, _error$response2, _error$response3, _error$response4;
|
|
1420
|
+
if (!error) return {
|
|
1421
|
+
error: null
|
|
1422
|
+
};
|
|
1423
|
+
return {
|
|
1424
|
+
name: error.name,
|
|
1425
|
+
message: error.message,
|
|
1426
|
+
code: error.code,
|
|
1427
|
+
stack: error.stack,
|
|
1428
|
+
responseStatus: (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status,
|
|
1429
|
+
responseStatusText: (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.statusText,
|
|
1430
|
+
responseData: typeof ((_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : _error$response3.data) === "string" ? error.response.data.slice(0, 500) : (_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : _error$response4.data
|
|
1431
|
+
};
|
|
1432
|
+
}
|
|
1433
|
+
});
|
|
1327
1434
|
_defineProperty(this, "generatePreSignedUrl", function (partNumber) {
|
|
1328
1435
|
var _classPrivateFieldGet6;
|
|
1329
1436
|
return partPresignedUrlApi.create({
|
|
@@ -1342,32 +1449,55 @@ var MultipartS3Uploader = /*#__PURE__*/function () {
|
|
|
1342
1449
|
writable: true,
|
|
1343
1450
|
value: function () {
|
|
1344
1451
|
var _value = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(chunks) {
|
|
1345
|
-
var _this$partNumber;
|
|
1346
|
-
var partNumber,
|
|
1452
|
+
var _this$partNumber, _classPrivateFieldGet7;
|
|
1453
|
+
var partNumber, partBlob, partBytes, presignStartedAt, presignedUrl, _yield$_this$generate, uploadStartedAt, s3PartUploadPromise;
|
|
1347
1454
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
1348
1455
|
while (1) switch (_context3.prev = _context3.next) {
|
|
1349
1456
|
case 0:
|
|
1350
|
-
_classPrivateFieldGet(_this, _logger$1).info("Part ready to be uploaded: ", _classPrivateFieldGet(_this, _partNumber));
|
|
1351
1457
|
partNumber = _classPrivateFieldGet(_this, _partNumber);
|
|
1352
1458
|
_classPrivateFieldSet(_this, _partNumber, (_this$partNumber = _classPrivateFieldGet(_this, _partNumber), _this$partNumber++, _this$partNumber));
|
|
1459
|
+
partBlob = new Blob(chunks, {
|
|
1460
|
+
type: _classPrivateFieldGet(_this, _mimeType$1)
|
|
1461
|
+
});
|
|
1462
|
+
partBytes = partBlob.size;
|
|
1353
1463
|
_classPrivateFieldGet(_this, _uploadProgress)[partNumber] = {
|
|
1354
1464
|
uploaded: 0,
|
|
1355
|
-
total:
|
|
1356
|
-
type: _classPrivateFieldGet(_this, _mimeType$1)
|
|
1357
|
-
}).size
|
|
1465
|
+
total: partBytes
|
|
1358
1466
|
};
|
|
1359
|
-
|
|
1360
|
-
|
|
1467
|
+
_classPrivateFieldGet(_this, _logger$1).info("upload chunk -> begin", {
|
|
1468
|
+
partNumber: partNumber,
|
|
1469
|
+
partBytes: partBytes,
|
|
1470
|
+
partMB: Number((partBytes / 1024 / 1024).toFixed(2)),
|
|
1471
|
+
mimeType: _classPrivateFieldGet(_this, _mimeType$1),
|
|
1472
|
+
recordingId: _classPrivateFieldGet(_this, _recordingId),
|
|
1473
|
+
uploadId: _classPrivateFieldGet(_this, _uploadId)
|
|
1474
|
+
});
|
|
1475
|
+
presignStartedAt = Date.now();
|
|
1476
|
+
_context3.prev = 7;
|
|
1477
|
+
_context3.next = 10;
|
|
1361
1478
|
return _this.generatePreSignedUrl(partNumber);
|
|
1362
|
-
case
|
|
1479
|
+
case 10:
|
|
1363
1480
|
_yield$_this$generate = _context3.sent;
|
|
1364
1481
|
presignedUrl = _yield$_this$generate.presignedUrl;
|
|
1365
|
-
_classPrivateFieldGet(_this, _logger$1).info("
|
|
1482
|
+
_classPrivateFieldGet(_this, _logger$1).info("upload chunk -> presigned url ready", {
|
|
1483
|
+
partNumber: partNumber,
|
|
1484
|
+
presignDurationMs: Date.now() - presignStartedAt
|
|
1485
|
+
});
|
|
1486
|
+
_context3.next = 19;
|
|
1487
|
+
break;
|
|
1488
|
+
case 15:
|
|
1489
|
+
_context3.prev = 15;
|
|
1490
|
+
_context3.t0 = _context3["catch"](7);
|
|
1491
|
+
_classPrivateFieldGet(_this, _handleChunkUploadError).call(_this, _context3.t0, partNumber, {
|
|
1492
|
+
phase: "presign",
|
|
1493
|
+
presignDurationMs: Date.now() - presignStartedAt
|
|
1494
|
+
});
|
|
1495
|
+
return _context3.abrupt("return");
|
|
1496
|
+
case 19:
|
|
1497
|
+
uploadStartedAt = Date.now();
|
|
1366
1498
|
s3PartUploadPromise = s3Api.presignedUpload({
|
|
1367
1499
|
presignedUrl: presignedUrl,
|
|
1368
|
-
blob:
|
|
1369
|
-
type: _classPrivateFieldGet(_this, _mimeType$1)
|
|
1370
|
-
}),
|
|
1500
|
+
blob: partBlob,
|
|
1371
1501
|
config: {
|
|
1372
1502
|
headers: {
|
|
1373
1503
|
"Content-Type": _classPrivateFieldGet(_this, _mimeType$1)
|
|
@@ -1381,28 +1511,52 @@ var MultipartS3Uploader = /*#__PURE__*/function () {
|
|
|
1381
1511
|
};
|
|
1382
1512
|
if (_this.status === UPLOAD_STATUS.uploading) {
|
|
1383
1513
|
var percentCompleted = calculateUploadProgress(_classPrivateFieldGet(_this, _uploadProgress));
|
|
1384
|
-
|
|
1514
|
+
|
|
1515
|
+
// Only log every 10% to keep noise down while still being useful.
|
|
1516
|
+
// Tracker is on the instance so concurrent chunk uploads don't
|
|
1517
|
+
// each log when the *overall* percent crosses a threshold.
|
|
1518
|
+
if (percentCompleted - _classPrivateFieldGet(_this, _lastLoggedOverallPercent) >= 10 || percentCompleted === 100) {
|
|
1519
|
+
_classPrivateFieldGet(_this, _logger$1).info("upload progress", {
|
|
1520
|
+
overallPercent: percentCompleted,
|
|
1521
|
+
partNumber: partNumber,
|
|
1522
|
+
partLoaded: e.loaded,
|
|
1523
|
+
partTotal: e.total
|
|
1524
|
+
});
|
|
1525
|
+
_classPrivateFieldSet(_this, _lastLoggedOverallPercent, percentCompleted);
|
|
1526
|
+
}
|
|
1385
1527
|
_classPrivateFieldGet(_this, _fireCallbacks$1).call(_this, UPLOAD_EVENT.onProgress, [percentCompleted]);
|
|
1386
1528
|
}
|
|
1387
1529
|
}
|
|
1388
1530
|
}
|
|
1389
1531
|
})
|
|
1390
1532
|
// eslint-disable-next-line promise/prefer-await-to-then
|
|
1533
|
+
.then(function (response) {
|
|
1534
|
+
var _response$headers;
|
|
1535
|
+
var durationMs = Date.now() - uploadStartedAt;
|
|
1536
|
+
_classPrivateFieldGet(_this, _logger$1).info("upload chunk -> success", {
|
|
1537
|
+
partNumber: partNumber,
|
|
1538
|
+
partBytes: partBytes,
|
|
1539
|
+
durationMs: durationMs,
|
|
1540
|
+
throughputMbps: durationMs ? Number((partBytes * 8 / 1000 / durationMs).toFixed(2)) : null,
|
|
1541
|
+
httpStatus: response === null || response === void 0 ? void 0 : response.status,
|
|
1542
|
+
etag: response === null || response === void 0 ? void 0 : (_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers.etag
|
|
1543
|
+
});
|
|
1544
|
+
return response;
|
|
1545
|
+
})
|
|
1546
|
+
// eslint-disable-next-line promise/prefer-await-to-then
|
|
1391
1547
|
["catch"](function (error) {
|
|
1392
|
-
_classPrivateFieldGet(_this, _handleChunkUploadError).call(_this, error, partNumber
|
|
1548
|
+
_classPrivateFieldGet(_this, _handleChunkUploadError).call(_this, error, partNumber, {
|
|
1549
|
+
phase: "upload",
|
|
1550
|
+
uploadDurationMs: Date.now() - uploadStartedAt,
|
|
1551
|
+
partBytes: partBytes
|
|
1552
|
+
});
|
|
1393
1553
|
});
|
|
1394
1554
|
_classPrivateFieldGet(_this, _s3PartUploadPromises).push(s3PartUploadPromise);
|
|
1395
|
-
|
|
1396
|
-
break;
|
|
1397
|
-
case 14:
|
|
1398
|
-
_context3.prev = 14;
|
|
1399
|
-
_context3.t0 = _context3["catch"](4);
|
|
1400
|
-
_classPrivateFieldGet(_this, _handleChunkUploadError).call(_this, _context3.t0, partNumber);
|
|
1401
|
-
case 17:
|
|
1555
|
+
case 22:
|
|
1402
1556
|
case "end":
|
|
1403
1557
|
return _context3.stop();
|
|
1404
1558
|
}
|
|
1405
|
-
}, _callee3, null, [[
|
|
1559
|
+
}, _callee3, null, [[7, 15]]);
|
|
1406
1560
|
}));
|
|
1407
1561
|
function value(_x2) {
|
|
1408
1562
|
return _value.apply(this, arguments);
|
|
@@ -1418,7 +1572,10 @@ var MultipartS3Uploader = /*#__PURE__*/function () {
|
|
|
1418
1572
|
});
|
|
1419
1573
|
}
|
|
1420
1574
|
});
|
|
1421
|
-
_classPrivateFieldGet(this, _logger$1).info("Uploader initialized"
|
|
1575
|
+
_classPrivateFieldGet(this, _logger$1).info("Uploader initialized", {
|
|
1576
|
+
mimeType: _classPrivateFieldGet(this, _mimeType$1),
|
|
1577
|
+
minUploadChunkSize: this.MIN_UPLOAD_CHUNK_SIZE
|
|
1578
|
+
});
|
|
1422
1579
|
}
|
|
1423
1580
|
_createClass(MultipartS3Uploader, [{
|
|
1424
1581
|
key: "status",
|
|
@@ -1562,6 +1719,9 @@ var _fireCallbacks = /*#__PURE__*/new WeakMap();
|
|
|
1562
1719
|
var _onRecordingStart = /*#__PURE__*/new WeakMap();
|
|
1563
1720
|
var _onRecordingActive = /*#__PURE__*/new WeakMap();
|
|
1564
1721
|
var _onRecordingStop = /*#__PURE__*/new WeakMap();
|
|
1722
|
+
var _serializeError = /*#__PURE__*/new WeakMap();
|
|
1723
|
+
var _summarizeStream = /*#__PURE__*/new WeakMap();
|
|
1724
|
+
var _summarizeRecorderState = /*#__PURE__*/new WeakMap();
|
|
1565
1725
|
var _startMediaRecorder = /*#__PURE__*/new WeakMap();
|
|
1566
1726
|
var _startCountdown = /*#__PURE__*/new WeakMap();
|
|
1567
1727
|
var _startTimer = /*#__PURE__*/new WeakMap();
|
|
@@ -1763,36 +1923,81 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
1763
1923
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
1764
1924
|
while (1) switch (_context.prev = _context.next) {
|
|
1765
1925
|
case 0:
|
|
1926
|
+
_classPrivateFieldGet(_this, _logger).info("startRecording -> begin", _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this, {
|
|
1927
|
+
showCountdown: _classPrivateFieldGet(_this, _showCountdown),
|
|
1928
|
+
timeLimit: _classPrivateFieldGet(_this, _timeLimit),
|
|
1929
|
+
mimeType: _classPrivateFieldGet(_this, _mimeType),
|
|
1930
|
+
recordSystemAudio: _classPrivateFieldGet(_this, _recordSystemAudio),
|
|
1931
|
+
enableNoiseCancellation: _classPrivateFieldGet(_this, _enableNoiseCancellation),
|
|
1932
|
+
hasInjectedVideoStream: Boolean(_classPrivateFieldGet(_this, _videoStream))
|
|
1933
|
+
}));
|
|
1766
1934
|
_classPrivateFieldGet(_this, _store).setState(pick(["error"], initialState));
|
|
1767
1935
|
if (_classPrivateFieldGet(_this, _mediaStream)) {
|
|
1768
|
-
_context.next =
|
|
1936
|
+
_context.next = 6;
|
|
1769
1937
|
break;
|
|
1770
1938
|
}
|
|
1771
|
-
_classPrivateFieldGet(_this, _logger).info("acquiring media stream");
|
|
1772
|
-
_context.next =
|
|
1939
|
+
_classPrivateFieldGet(_this, _logger).info("startRecording -> acquiring media stream");
|
|
1940
|
+
_context.next = 6;
|
|
1773
1941
|
return _classPrivateFieldGet(_this, _acquireMediaStream).call(_this);
|
|
1774
|
-
case
|
|
1942
|
+
case 6:
|
|
1775
1943
|
if (!(_classPrivateFieldGet(_this, _mediaStream) && isStreamEnded(_classPrivateFieldGet(_this, _mediaStream)))) {
|
|
1776
|
-
_context.next =
|
|
1944
|
+
_context.next = 10;
|
|
1777
1945
|
break;
|
|
1778
1946
|
}
|
|
1779
|
-
_classPrivateFieldGet(_this, _logger).info("media stream ended, acquiring
|
|
1780
|
-
_context.next =
|
|
1947
|
+
_classPrivateFieldGet(_this, _logger).info("startRecording -> media stream ended, re-acquiring", _classPrivateFieldGet(_this, _summarizeStream).call(_this, _classPrivateFieldGet(_this, _mediaStream)));
|
|
1948
|
+
_context.next = 10;
|
|
1781
1949
|
return _classPrivateFieldGet(_this, _acquireMediaStream).call(_this);
|
|
1782
|
-
case
|
|
1950
|
+
case 10:
|
|
1783
1951
|
if (!(!_classPrivateFieldGet(_this, _mediaStream) || isStreamEnded(_classPrivateFieldGet(_this, _mediaStream)))) {
|
|
1784
|
-
_context.next =
|
|
1952
|
+
_context.next = 13;
|
|
1785
1953
|
break;
|
|
1786
1954
|
}
|
|
1955
|
+
_classPrivateFieldGet(_this, _logger).warn("startRecording -> aborting, media stream unavailable", {
|
|
1956
|
+
hasMediaStream: Boolean(_classPrivateFieldGet(_this, _mediaStream)),
|
|
1957
|
+
isEnded: _classPrivateFieldGet(_this, _mediaStream) ? isStreamEnded(_classPrivateFieldGet(_this, _mediaStream)) : true
|
|
1958
|
+
});
|
|
1787
1959
|
return _context.abrupt("return");
|
|
1788
|
-
case
|
|
1960
|
+
case 13:
|
|
1789
1961
|
options = getMediaRecorderOptions();
|
|
1962
|
+
_classPrivateFieldGet(_this, _logger).info("startRecording -> creating MediaRecorder", {
|
|
1963
|
+
options: options,
|
|
1964
|
+
mimeType: _classPrivateFieldGet(_this, _mimeType),
|
|
1965
|
+
stream: _classPrivateFieldGet(_this, _summarizeStream).call(_this, _classPrivateFieldGet(_this, _mediaStream))
|
|
1966
|
+
});
|
|
1790
1967
|
_classPrivateFieldSet(_this, _mediaChunks, []);
|
|
1968
|
+
_context.prev = 16;
|
|
1791
1969
|
_classPrivateFieldSet(_this, _mediaRecorder, new MediaRecorder(_classPrivateFieldGet(_this, _mediaStream), options));
|
|
1970
|
+
_context.next = 25;
|
|
1971
|
+
break;
|
|
1972
|
+
case 20:
|
|
1973
|
+
_context.prev = 20;
|
|
1974
|
+
_context.t0 = _context["catch"](16);
|
|
1975
|
+
_classPrivateFieldGet(_this, _logger).error("startRecording -> failed to construct MediaRecorder", _classPrivateFieldGet(_this, _serializeError).call(_this, _context.t0), {
|
|
1976
|
+
options: options,
|
|
1977
|
+
mimeType: _classPrivateFieldGet(_this, _mimeType)
|
|
1978
|
+
});
|
|
1979
|
+
_classPrivateFieldGet(_this, _store).setState({
|
|
1980
|
+
status: SCREEN_RECORDER_STATUS.idle,
|
|
1981
|
+
error: SCREEN_RECORDER_ERROR.NoRecorder
|
|
1982
|
+
});
|
|
1983
|
+
return _context.abrupt("return");
|
|
1984
|
+
case 25:
|
|
1985
|
+
_classPrivateFieldGet(_this, _logger).info("startRecording -> MediaRecorder created", {
|
|
1986
|
+
state: _classPrivateFieldGet(_this, _mediaRecorder).state,
|
|
1987
|
+
mimeType: _classPrivateFieldGet(_this, _mediaRecorder).mimeType,
|
|
1988
|
+
videoBitsPerSecond: _classPrivateFieldGet(_this, _mediaRecorder).videoBitsPerSecond,
|
|
1989
|
+
audioBitsPerSecond: _classPrivateFieldGet(_this, _mediaRecorder).audioBitsPerSecond
|
|
1990
|
+
});
|
|
1792
1991
|
_classPrivateFieldGet(_this, _mediaRecorder).ondataavailable = _classPrivateFieldGet(_this, _onRecordingActive);
|
|
1793
1992
|
_classPrivateFieldGet(_this, _mediaRecorder).onstart = _classPrivateFieldGet(_this, _onRecordingStart);
|
|
1794
1993
|
_classPrivateFieldGet(_this, _mediaRecorder).onstop = _classPrivateFieldGet(_this, _onRecordingStop);
|
|
1795
|
-
_classPrivateFieldGet(_this, _mediaRecorder).onerror = function () {
|
|
1994
|
+
_classPrivateFieldGet(_this, _mediaRecorder).onerror = function (event) {
|
|
1995
|
+
var _classPrivateFieldGet4;
|
|
1996
|
+
_classPrivateFieldGet(_this, _logger).error("MediaRecorder.onerror fired", _classPrivateFieldGet(_this, _serializeError).call(_this, event === null || event === void 0 ? void 0 : event.error), {
|
|
1997
|
+
state: (_classPrivateFieldGet4 = _classPrivateFieldGet(_this, _mediaRecorder)) === null || _classPrivateFieldGet4 === void 0 ? void 0 : _classPrivateFieldGet4.state,
|
|
1998
|
+
chunkCount: _classPrivateFieldGet(_this, _mediaChunks).length,
|
|
1999
|
+
stream: _classPrivateFieldGet(_this, _summarizeStream).call(_this, _classPrivateFieldGet(_this, _mediaStream))
|
|
2000
|
+
});
|
|
1796
2001
|
_classPrivateFieldGet(_this, _store).setState({
|
|
1797
2002
|
status: SCREEN_RECORDER_STATUS.idle,
|
|
1798
2003
|
error: SCREEN_RECORDER_ERROR.NoRecorder
|
|
@@ -1803,24 +2008,24 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
1803
2008
|
} else {
|
|
1804
2009
|
_classPrivateFieldGet(_this, _startMediaRecorder).call(_this);
|
|
1805
2010
|
}
|
|
1806
|
-
case
|
|
2011
|
+
case 31:
|
|
1807
2012
|
case "end":
|
|
1808
2013
|
return _context.stop();
|
|
1809
2014
|
}
|
|
1810
|
-
}, _callee);
|
|
2015
|
+
}, _callee, null, [[16, 20]]);
|
|
1811
2016
|
})));
|
|
1812
2017
|
_defineProperty(this, "stopRecording", function () {
|
|
1813
|
-
var
|
|
2018
|
+
var _classPrivateFieldGet5;
|
|
1814
2019
|
if (_classPrivateFieldGet(_this, _mediaRecorder) === undefined) {
|
|
1815
|
-
_classPrivateFieldGet(_this, _logger).info("
|
|
2020
|
+
_classPrivateFieldGet(_this, _logger).info("stopRecording -> mediaRecorder undefined, stopping streams only", _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this));
|
|
1816
2021
|
/**
|
|
1817
2022
|
* If the permission is denied and "Stop sharing" overlay is clicked
|
|
1818
2023
|
*/
|
|
1819
2024
|
_classPrivateFieldGet(_this, _stopAllStreams).call(_this);
|
|
1820
2025
|
return;
|
|
1821
2026
|
}
|
|
1822
|
-
if (((
|
|
1823
|
-
_classPrivateFieldGet(_this, _logger).info("
|
|
2027
|
+
if (((_classPrivateFieldGet5 = _classPrivateFieldGet(_this, _mediaRecorder)) === null || _classPrivateFieldGet5 === void 0 ? void 0 : _classPrivateFieldGet5.state) === "inactive") {
|
|
2028
|
+
_classPrivateFieldGet(_this, _logger).info("stopRecording -> mediaRecorder inactive, treating as discard during countdown", _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this));
|
|
1824
2029
|
// When recording is stopped from the 'Stop Sharing' overlay
|
|
1825
2030
|
// before it even starts, i.e during the countdown.
|
|
1826
2031
|
// Or if the recording is stopped before startRecordingTimeoutID timeout executes
|
|
@@ -1831,6 +2036,7 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
1831
2036
|
_classPrivateFieldGet(_this, _fireCallbacks).call(_this, SCREEN_RECORDER_EVENT.onDiscardDuringCountdown);
|
|
1832
2037
|
return;
|
|
1833
2038
|
}
|
|
2039
|
+
_classPrivateFieldGet(_this, _logger).info("stopRecording -> stopping", _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this));
|
|
1834
2040
|
_classPrivateFieldGet(_this, _store).setState({
|
|
1835
2041
|
status: SCREEN_RECORDER_STATUS.stopping
|
|
1836
2042
|
});
|
|
@@ -1839,31 +2045,38 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
1839
2045
|
_classPrivateFieldGet(_this, _stopTimer).call(_this);
|
|
1840
2046
|
});
|
|
1841
2047
|
_defineProperty(this, "pauseRecording", function () {
|
|
1842
|
-
var
|
|
1843
|
-
if (((
|
|
1844
|
-
_classPrivateFieldGet(_this, _logger).info("
|
|
2048
|
+
var _classPrivateFieldGet6;
|
|
2049
|
+
if (((_classPrivateFieldGet6 = _classPrivateFieldGet(_this, _mediaRecorder)) === null || _classPrivateFieldGet6 === void 0 ? void 0 : _classPrivateFieldGet6.state) === "recording") {
|
|
2050
|
+
_classPrivateFieldGet(_this, _logger).info("pauseRecording", _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this));
|
|
1845
2051
|
_classPrivateFieldGet(_this, _store).setState({
|
|
1846
2052
|
status: SCREEN_RECORDER_STATUS.paused
|
|
1847
2053
|
});
|
|
1848
2054
|
_classPrivateFieldGet(_this, _mediaRecorder).pause();
|
|
2055
|
+
} else {
|
|
2056
|
+
_classPrivateFieldGet(_this, _logger).warn("pauseRecording -> ignored, recorder not in recording state", _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this));
|
|
1849
2057
|
}
|
|
1850
2058
|
_classPrivateFieldGet(_this, _stopTimer).call(_this);
|
|
1851
2059
|
});
|
|
1852
2060
|
_defineProperty(this, "resumeRecording", function () {
|
|
1853
|
-
var
|
|
1854
|
-
if (((
|
|
1855
|
-
_classPrivateFieldGet(_this, _logger).info("
|
|
2061
|
+
var _classPrivateFieldGet7;
|
|
2062
|
+
if (((_classPrivateFieldGet7 = _classPrivateFieldGet(_this, _mediaRecorder)) === null || _classPrivateFieldGet7 === void 0 ? void 0 : _classPrivateFieldGet7.state) === "paused") {
|
|
2063
|
+
_classPrivateFieldGet(_this, _logger).info("resumeRecording", _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this));
|
|
1856
2064
|
_classPrivateFieldGet(_this, _store).setState({
|
|
1857
2065
|
status: SCREEN_RECORDER_STATUS.recording
|
|
1858
2066
|
});
|
|
1859
2067
|
_classPrivateFieldGet(_this, _mediaRecorder).resume();
|
|
2068
|
+
} else {
|
|
2069
|
+
_classPrivateFieldGet(_this, _logger).warn("resumeRecording -> ignored, recorder not paused", _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this));
|
|
1860
2070
|
}
|
|
1861
2071
|
_classPrivateFieldGet(_this, _startTimer).call(_this);
|
|
1862
2072
|
});
|
|
1863
2073
|
_defineProperty(this, "discardRecording", function () {
|
|
1864
|
-
var
|
|
1865
|
-
if (((
|
|
1866
|
-
|
|
2074
|
+
var _classPrivateFieldGet8;
|
|
2075
|
+
if (((_classPrivateFieldGet8 = _classPrivateFieldGet(_this, _mediaRecorder)) === null || _classPrivateFieldGet8 === void 0 ? void 0 : _classPrivateFieldGet8.state) === "inactive") {
|
|
2076
|
+
_classPrivateFieldGet(_this, _logger).info("discardRecording -> ignored, recorder already inactive", _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this));
|
|
2077
|
+
return;
|
|
2078
|
+
}
|
|
2079
|
+
_classPrivateFieldGet(_this, _logger).info("discardRecording", _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this));
|
|
1867
2080
|
_classPrivateFieldGet(_this, _store).setState({
|
|
1868
2081
|
status: SCREEN_RECORDER_STATUS.stopping
|
|
1869
2082
|
});
|
|
@@ -1876,7 +2089,7 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
1876
2089
|
_classPrivateFieldGet(_this, _fireCallbacks).call(_this, SCREEN_RECORDER_EVENT.onDiscard);
|
|
1877
2090
|
});
|
|
1878
2091
|
_defineProperty(this, "restartRecording", function () {
|
|
1879
|
-
_classPrivateFieldGet(_this, _logger).info("
|
|
2092
|
+
_classPrivateFieldGet(_this, _logger).info("restartRecording", _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this));
|
|
1880
2093
|
_classPrivateFieldGet(_this, _store).setState({
|
|
1881
2094
|
status: SCREEN_RECORDER_STATUS.stopping
|
|
1882
2095
|
});
|
|
@@ -1889,7 +2102,7 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
1889
2102
|
_this.startRecording();
|
|
1890
2103
|
});
|
|
1891
2104
|
_defineProperty(this, "resetState", function () {
|
|
1892
|
-
_classPrivateFieldGet(_this, _logger).info("
|
|
2105
|
+
_classPrivateFieldGet(_this, _logger).info("resetState", _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this));
|
|
1893
2106
|
_classPrivateFieldSet(_this, _mediaChunks, []);
|
|
1894
2107
|
_classPrivateFieldSet(_this, _callbacks, {});
|
|
1895
2108
|
_classPrivateFieldSet(_this, _dataReceiving, false);
|
|
@@ -1899,7 +2112,7 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
1899
2112
|
_classPrivateFieldGet(_this, _checkCompatibility).call(_this);
|
|
1900
2113
|
});
|
|
1901
2114
|
_defineProperty(this, "revokePermissions", function () {
|
|
1902
|
-
_classPrivateFieldGet(_this, _logger).info("
|
|
2115
|
+
_classPrivateFieldGet(_this, _logger).info("revokePermissions", _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this));
|
|
1903
2116
|
if (!_classPrivateFieldGet(_this, _mediaRecorder)) return;
|
|
1904
2117
|
_classPrivateFieldGet(_this, _mediaRecorder).onstop = null;
|
|
1905
2118
|
_classPrivateFieldGet(_this, _stopAllStreams).call(_this);
|
|
@@ -1907,18 +2120,23 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
1907
2120
|
_classPrivateFieldInitSpec(this, _stopAllStreams, {
|
|
1908
2121
|
writable: true,
|
|
1909
2122
|
value: function value() {
|
|
1910
|
-
var
|
|
1911
|
-
_classPrivateFieldGet(_this, _logger).info("
|
|
1912
|
-
|
|
2123
|
+
var _classPrivateFieldGet9, _classPrivateFieldGet10, _classPrivateFieldGet11, _classPrivateFieldGet12, _classPrivateFieldGet13, _classPrivateFieldGet14;
|
|
2124
|
+
_classPrivateFieldGet(_this, _logger).info("stopAllStreams", {
|
|
2125
|
+
mediaStream: _classPrivateFieldGet(_this, _summarizeStream).call(_this, _classPrivateFieldGet(_this, _mediaStream)),
|
|
2126
|
+
stream: _classPrivateFieldGet(_this, _summarizeStream).call(_this, _classPrivateFieldGet(_this, _stream)),
|
|
2127
|
+
audioStream: _classPrivateFieldGet(_this, _summarizeStream).call(_this, _classPrivateFieldGet(_this, _audioStream)),
|
|
2128
|
+
micAudioStream: _classPrivateFieldGet(_this, _summarizeStream).call(_this, _classPrivateFieldGet(_this, _micAudioStream))
|
|
2129
|
+
});
|
|
2130
|
+
_classPrivateFieldGet(_this, _mediaStream) && ((_classPrivateFieldGet9 = _classPrivateFieldGet(_this, _mediaStream)) === null || _classPrivateFieldGet9 === void 0 ? void 0 : _classPrivateFieldGet9.getTracks().forEach(function (track) {
|
|
1913
2131
|
return track.stop();
|
|
1914
2132
|
}));
|
|
1915
|
-
(
|
|
2133
|
+
(_classPrivateFieldGet10 = _classPrivateFieldGet(_this, _stream)) === null || _classPrivateFieldGet10 === void 0 ? void 0 : _classPrivateFieldGet10.getTracks().forEach(function (track) {
|
|
1916
2134
|
return track.stop();
|
|
1917
2135
|
});
|
|
1918
|
-
(
|
|
2136
|
+
(_classPrivateFieldGet11 = _classPrivateFieldGet(_this, _audioStream)) === null || _classPrivateFieldGet11 === void 0 ? void 0 : (_classPrivateFieldGet12 = _classPrivateFieldGet11.getAudioTracks()) === null || _classPrivateFieldGet12 === void 0 ? void 0 : _classPrivateFieldGet12.forEach(function (track) {
|
|
1919
2137
|
return track.stop();
|
|
1920
2138
|
});
|
|
1921
|
-
(
|
|
2139
|
+
(_classPrivateFieldGet13 = _classPrivateFieldGet(_this, _micAudioStream)) === null || _classPrivateFieldGet13 === void 0 ? void 0 : (_classPrivateFieldGet14 = _classPrivateFieldGet13.getAudioTracks()) === null || _classPrivateFieldGet14 === void 0 ? void 0 : _classPrivateFieldGet14.forEach(function (track) {
|
|
1922
2140
|
return track.stop();
|
|
1923
2141
|
});
|
|
1924
2142
|
}
|
|
@@ -1953,39 +2171,51 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
1953
2171
|
writable: true,
|
|
1954
2172
|
value: function () {
|
|
1955
2173
|
var _value = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
1956
|
-
var stream, constraints, audioConfig, audioStream, workletUrl, audioContext, audioStreamSource, destinationStream, noiseSuppressorNode, finalStream, _audioContext, desktopAudio, microphoneAudio, combinedAudio;
|
|
2174
|
+
var acquireStartedAt, stream, constraints, displayMediaStartedAt, audioConfig, micStartedAt, audioStream, workletUrl, workletStartedAt, audioContext, audioStreamSource, destinationStream, noiseSuppressorNode, finalStream, _audioContext, desktopAudio, microphoneAudio, combinedAudio;
|
|
1957
2175
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
1958
2176
|
while (1) switch (_context2.prev = _context2.next) {
|
|
1959
2177
|
case 0:
|
|
1960
|
-
|
|
2178
|
+
acquireStartedAt = Date.now();
|
|
2179
|
+
_classPrivateFieldGet(_this, _logger).info("acquireMediaStream -> begin", {
|
|
2180
|
+
hasInjectedVideoStream: Boolean(_classPrivateFieldGet(_this, _videoStream)),
|
|
2181
|
+
audio: Boolean(_classPrivateFieldGet(_this, _audio)),
|
|
2182
|
+
recordSystemAudio: _classPrivateFieldGet(_this, _recordSystemAudio),
|
|
2183
|
+
enableNoiseCancellation: _classPrivateFieldGet(_this, _enableNoiseCancellation)
|
|
2184
|
+
});
|
|
1961
2185
|
_classPrivateFieldGet(_this, _store).setState({
|
|
1962
2186
|
status: SCREEN_RECORDER_STATUS.acquiring_media
|
|
1963
2187
|
});
|
|
1964
|
-
_context2.prev =
|
|
2188
|
+
_context2.prev = 3;
|
|
1965
2189
|
if (!_classPrivateFieldGet(_this, _videoStream)) {
|
|
1966
|
-
_context2.next =
|
|
2190
|
+
_context2.next = 9;
|
|
1967
2191
|
break;
|
|
1968
2192
|
}
|
|
2193
|
+
_classPrivateFieldGet(_this, _logger).info("acquireMediaStream -> using injected videoStream", _classPrivateFieldGet(_this, _summarizeStream).call(_this, _classPrivateFieldGet(_this, _videoStream)));
|
|
1969
2194
|
stream = _classPrivateFieldGet(_this, _videoStream);
|
|
1970
|
-
_context2.next =
|
|
2195
|
+
_context2.next = 17;
|
|
1971
2196
|
break;
|
|
1972
|
-
case
|
|
2197
|
+
case 9:
|
|
1973
2198
|
constraints = {
|
|
1974
2199
|
video: _classPrivateFieldGet(_this, _video),
|
|
1975
2200
|
audio: _classPrivateFieldGet(_this, _recordSystemAudio)
|
|
1976
2201
|
};
|
|
1977
|
-
_classPrivateFieldGet(_this, _logger).info("
|
|
1978
|
-
|
|
2202
|
+
_classPrivateFieldGet(_this, _logger).info("acquireMediaStream -> getDisplayMedia constraints", constraints);
|
|
2203
|
+
displayMediaStartedAt = Date.now();
|
|
2204
|
+
_context2.next = 14;
|
|
1979
2205
|
return window.navigator.mediaDevices.getDisplayMedia(constraints);
|
|
1980
|
-
case
|
|
2206
|
+
case 14:
|
|
1981
2207
|
stream = _context2.sent;
|
|
2208
|
+
_classPrivateFieldGet(_this, _logger).info("acquireMediaStream -> getDisplayMedia resolved", {
|
|
2209
|
+
durationMs: Date.now() - displayMediaStartedAt,
|
|
2210
|
+
stream: _classPrivateFieldGet(_this, _summarizeStream).call(_this, stream)
|
|
2211
|
+
});
|
|
1982
2212
|
_classPrivateFieldGet(_this, _fireCallbacks).call(_this, SCREEN_RECORDER_EVENT.onShareSelected);
|
|
1983
|
-
case
|
|
2213
|
+
case 17:
|
|
1984
2214
|
if (!_classPrivateFieldGet(_this, _audio)) {
|
|
1985
|
-
_context2.next =
|
|
2215
|
+
_context2.next = 57;
|
|
1986
2216
|
break;
|
|
1987
2217
|
}
|
|
1988
|
-
_context2.prev =
|
|
2218
|
+
_context2.prev = 18;
|
|
1989
2219
|
audioConfig = {
|
|
1990
2220
|
audio: _objectSpread(_objectSpread({
|
|
1991
2221
|
echoCancellation: false
|
|
@@ -1995,60 +2225,81 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
1995
2225
|
}
|
|
1996
2226
|
})
|
|
1997
2227
|
};
|
|
1998
|
-
_classPrivateFieldGet(_this, _logger).info("
|
|
2228
|
+
_classPrivateFieldGet(_this, _logger).info("acquireMediaStream -> getUserMedia audioConfig", audioConfig);
|
|
2229
|
+
micStartedAt = Date.now();
|
|
1999
2230
|
_context2.t0 = _classPrivateFieldSet;
|
|
2000
2231
|
_context2.t1 = _this;
|
|
2001
2232
|
_context2.t2 = _micAudioStream;
|
|
2002
|
-
_context2.next =
|
|
2233
|
+
_context2.next = 27;
|
|
2003
2234
|
return window.navigator.mediaDevices.getUserMedia(audioConfig);
|
|
2004
|
-
case
|
|
2235
|
+
case 27:
|
|
2005
2236
|
_context2.t3 = _context2.sent;
|
|
2006
2237
|
(0, _context2.t0)(_context2.t1, _context2.t2, _context2.t3);
|
|
2238
|
+
_classPrivateFieldGet(_this, _logger).info("acquireMediaStream -> mic acquired", {
|
|
2239
|
+
durationMs: Date.now() - micStartedAt,
|
|
2240
|
+
stream: _classPrivateFieldGet(_this, _summarizeStream).call(_this, _classPrivateFieldGet(_this, _micAudioStream))
|
|
2241
|
+
});
|
|
2007
2242
|
audioStream = addGainNode(_classPrivateFieldGet(_this, _micAudioStream), 1.75); // Increase volume by 50%
|
|
2008
2243
|
_classPrivateFieldSet(_this, _audioStream, audioStream);
|
|
2009
2244
|
if (!_classPrivateFieldGet(_this, _enableNoiseCancellation)) {
|
|
2010
|
-
_context2.next =
|
|
2245
|
+
_context2.next = 52;
|
|
2011
2246
|
break;
|
|
2012
2247
|
}
|
|
2013
|
-
_context2.prev =
|
|
2248
|
+
_context2.prev = 33;
|
|
2014
2249
|
workletUrl = IS_EXTENSION ?
|
|
2015
2250
|
// eslint-disable-next-line no-undef
|
|
2016
2251
|
chrome.runtime.getURL("public/NoiseSuppressorWorklet.js") : "NoiseSuppressorWorklet.js";
|
|
2252
|
+
_classPrivateFieldGet(_this, _logger).info("acquireMediaStream -> loading noise suppressor worklet", {
|
|
2253
|
+
workletUrl: workletUrl
|
|
2254
|
+
});
|
|
2255
|
+
workletStartedAt = Date.now();
|
|
2017
2256
|
audioContext = new AudioContext();
|
|
2018
|
-
_context2.next =
|
|
2257
|
+
_context2.next = 40;
|
|
2019
2258
|
return audioContext.audioWorklet.addModule(workletUrl);
|
|
2020
|
-
case
|
|
2259
|
+
case 40:
|
|
2021
2260
|
audioStreamSource = audioContext.createMediaStreamSource(audioStream);
|
|
2022
2261
|
destinationStream = audioContext.createMediaStreamDestination();
|
|
2023
2262
|
noiseSuppressorNode = new AudioWorkletNode(audioContext, "nn-suppressor-processor");
|
|
2024
2263
|
audioStreamSource.connect(noiseSuppressorNode);
|
|
2025
2264
|
noiseSuppressorNode.connect(destinationStream);
|
|
2026
2265
|
_classPrivateFieldSet(_this, _audioStream, destinationStream.stream);
|
|
2027
|
-
|
|
2266
|
+
_classPrivateFieldGet(_this, _logger).info("acquireMediaStream -> noise suppressor wired up", {
|
|
2267
|
+
durationMs: Date.now() - workletStartedAt
|
|
2268
|
+
});
|
|
2269
|
+
_context2.next = 52;
|
|
2028
2270
|
break;
|
|
2029
|
-
case
|
|
2030
|
-
_context2.prev =
|
|
2031
|
-
_context2.t4 = _context2["catch"](
|
|
2032
|
-
_classPrivateFieldGet(_this, _logger).error("
|
|
2033
|
-
case
|
|
2034
|
-
_context2.next =
|
|
2271
|
+
case 49:
|
|
2272
|
+
_context2.prev = 49;
|
|
2273
|
+
_context2.t4 = _context2["catch"](33);
|
|
2274
|
+
_classPrivateFieldGet(_this, _logger).error("acquireMediaStream -> failed to load audio worklet", _classPrivateFieldGet(_this, _serializeError).call(_this, _context2.t4));
|
|
2275
|
+
case 52:
|
|
2276
|
+
_context2.next = 57;
|
|
2035
2277
|
break;
|
|
2036
|
-
case
|
|
2037
|
-
_context2.prev =
|
|
2038
|
-
_context2.t5 = _context2["catch"](
|
|
2278
|
+
case 54:
|
|
2279
|
+
_context2.prev = 54;
|
|
2280
|
+
_context2.t5 = _context2["catch"](18);
|
|
2039
2281
|
// Mic access can fail independently of screen capture (OS-level
|
|
2040
2282
|
// block, no device, deviceId mismatch). Screen sharing already
|
|
2041
2283
|
// succeeded, so fall back to a video-only recording instead of
|
|
2042
2284
|
// surfacing the failure as a screen permission error.
|
|
2043
|
-
_classPrivateFieldGet(_this, _logger).
|
|
2044
|
-
|
|
2285
|
+
_classPrivateFieldGet(_this, _logger).warn("acquireMediaStream -> mic unavailable, falling back to video-only", _classPrivateFieldGet(_this, _serializeError).call(_this, _context2.t5), {
|
|
2286
|
+
audioConfigRequested: _classPrivateFieldGet(_this, _audio)
|
|
2287
|
+
});
|
|
2288
|
+
case 57:
|
|
2045
2289
|
// Event triggered when the user clicks on the stop sharing overlay button
|
|
2046
2290
|
stream.getVideoTracks()[0].addEventListener("ended", function () {
|
|
2291
|
+
var _classPrivateFieldGet15;
|
|
2292
|
+
_classPrivateFieldGet(_this, _logger).info("display video track ended event received", {
|
|
2293
|
+
recorderState: (_classPrivateFieldGet15 = _classPrivateFieldGet(_this, _mediaRecorder)) === null || _classPrivateFieldGet15 === void 0 ? void 0 : _classPrivateFieldGet15.state,
|
|
2294
|
+
status: _classPrivateFieldGet(_this, _store).getState().status,
|
|
2295
|
+
stream: _classPrivateFieldGet(_this, _summarizeStream).call(_this, stream)
|
|
2296
|
+
});
|
|
2047
2297
|
_this.stopRecording();
|
|
2048
2298
|
});
|
|
2049
2299
|
finalStream = new MediaStream();
|
|
2050
2300
|
if (_classPrivateFieldGet(_this, _audio) && _classPrivateFieldGet(_this, _audioStream)) {
|
|
2051
2301
|
if (isNotEmpty(stream.getAudioTracks())) {
|
|
2302
|
+
_classPrivateFieldGet(_this, _logger).info("acquireMediaStream -> mixing system audio + mic");
|
|
2052
2303
|
_audioContext = new AudioContext();
|
|
2053
2304
|
desktopAudio = _audioContext.createMediaStreamSource(stream);
|
|
2054
2305
|
microphoneAudio = _audioContext.createMediaStreamSource(_classPrivateFieldGet(_this, _audioStream));
|
|
@@ -2059,14 +2310,18 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
2059
2310
|
return finalStream.addTrack(track);
|
|
2060
2311
|
});
|
|
2061
2312
|
} else {
|
|
2313
|
+
_classPrivateFieldGet(_this, _logger).info("acquireMediaStream -> using mic audio only (no system audio in display stream)");
|
|
2062
2314
|
_classPrivateFieldGet(_this, _audioStream).getAudioTracks().forEach(function (track) {
|
|
2063
2315
|
return finalStream.addTrack(track);
|
|
2064
2316
|
});
|
|
2065
2317
|
}
|
|
2066
2318
|
} else if (_classPrivateFieldGet(_this, _recordSystemAudio)) {
|
|
2319
|
+
_classPrivateFieldGet(_this, _logger).info("acquireMediaStream -> using system audio only");
|
|
2067
2320
|
stream.getAudioTracks().forEach(function (track) {
|
|
2068
2321
|
return finalStream.addTrack(track);
|
|
2069
2322
|
});
|
|
2323
|
+
} else {
|
|
2324
|
+
_classPrivateFieldGet(_this, _logger).info("acquireMediaStream -> recording without audio");
|
|
2070
2325
|
}
|
|
2071
2326
|
stream.getVideoTracks().forEach(function (track) {
|
|
2072
2327
|
return finalStream.addTrack(track);
|
|
@@ -2076,12 +2331,21 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
2076
2331
|
_classPrivateFieldGet(_this, _store).setState({
|
|
2077
2332
|
status: SCREEN_RECORDER_STATUS.media_acquired
|
|
2078
2333
|
});
|
|
2079
|
-
|
|
2334
|
+
_classPrivateFieldGet(_this, _logger).info("acquireMediaStream -> success", {
|
|
2335
|
+
totalDurationMs: Date.now() - acquireStartedAt,
|
|
2336
|
+
finalStream: _classPrivateFieldGet(_this, _summarizeStream).call(_this, _classPrivateFieldGet(_this, _mediaStream))
|
|
2337
|
+
});
|
|
2338
|
+
_context2.next = 71;
|
|
2080
2339
|
break;
|
|
2081
|
-
case
|
|
2082
|
-
_context2.prev =
|
|
2083
|
-
_context2.t6 = _context2["catch"](
|
|
2084
|
-
_classPrivateFieldGet(_this, _logger).
|
|
2340
|
+
case 67:
|
|
2341
|
+
_context2.prev = 67;
|
|
2342
|
+
_context2.t6 = _context2["catch"](3);
|
|
2343
|
+
_classPrivateFieldGet(_this, _logger).error("acquireMediaStream -> error", _classPrivateFieldGet(_this, _serializeError).call(_this, _context2.t6), {
|
|
2344
|
+
totalDurationMs: Date.now() - acquireStartedAt,
|
|
2345
|
+
hasAudio: Boolean(_classPrivateFieldGet(_this, _audio)),
|
|
2346
|
+
hasAudioStream: Boolean(_classPrivateFieldGet(_this, _audioStream)),
|
|
2347
|
+
hasMediaStream: Boolean(_classPrivateFieldGet(_this, _mediaStream))
|
|
2348
|
+
});
|
|
2085
2349
|
if (SCREEN_RECORDER_ERROR[_context2.t6 === null || _context2.t6 === void 0 ? void 0 : _context2.t6.name]) {
|
|
2086
2350
|
_classPrivateFieldGet(_this, _store).setState({
|
|
2087
2351
|
error: SCREEN_RECORDER_ERROR[_context2.t6.name],
|
|
@@ -2098,11 +2362,11 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
2098
2362
|
status: SCREEN_RECORDER_STATUS.idle
|
|
2099
2363
|
});
|
|
2100
2364
|
}
|
|
2101
|
-
case
|
|
2365
|
+
case 71:
|
|
2102
2366
|
case "end":
|
|
2103
2367
|
return _context2.stop();
|
|
2104
2368
|
}
|
|
2105
|
-
}, _callee2, null, [[
|
|
2369
|
+
}, _callee2, null, [[3, 67], [18, 54], [33, 49]]);
|
|
2106
2370
|
}));
|
|
2107
2371
|
function value() {
|
|
2108
2372
|
return _value.apply(this, arguments);
|
|
@@ -2113,9 +2377,9 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
2113
2377
|
_classPrivateFieldInitSpec(this, _fireCallbacks, {
|
|
2114
2378
|
writable: true,
|
|
2115
2379
|
value: function value(event) {
|
|
2116
|
-
var
|
|
2380
|
+
var _classPrivateFieldGet16;
|
|
2117
2381
|
var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
2118
|
-
(
|
|
2382
|
+
(_classPrivateFieldGet16 = _classPrivateFieldGet(_this, _callbacks)[event]) === null || _classPrivateFieldGet16 === void 0 ? void 0 : _classPrivateFieldGet16.forEach(function (callback) {
|
|
2119
2383
|
callback.apply(void 0, _toConsumableArray(args));
|
|
2120
2384
|
});
|
|
2121
2385
|
}
|
|
@@ -2123,25 +2387,49 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
2123
2387
|
_classPrivateFieldInitSpec(this, _onRecordingStart, {
|
|
2124
2388
|
writable: true,
|
|
2125
2389
|
value: function value() {
|
|
2126
|
-
_classPrivateFieldGet(_this, _logger).info("
|
|
2390
|
+
_classPrivateFieldGet(_this, _logger).info("MediaRecorder.onstart fired", _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this));
|
|
2127
2391
|
_classPrivateFieldGet(_this, _fireCallbacks).call(_this, SCREEN_RECORDER_EVENT.onStart);
|
|
2128
2392
|
}
|
|
2129
2393
|
});
|
|
2130
2394
|
_classPrivateFieldInitSpec(this, _onRecordingActive, {
|
|
2131
2395
|
writable: true,
|
|
2132
2396
|
value: function value(_ref2) {
|
|
2397
|
+
var _classPrivateFieldGet17;
|
|
2133
2398
|
var data = _ref2.data;
|
|
2134
|
-
|
|
2135
|
-
|
|
2399
|
+
if (data.size <= 0) {
|
|
2400
|
+
_classPrivateFieldGet(_this, _logger).warn("ondataavailable -> empty chunk, ignoring", {
|
|
2401
|
+
chunkCount: _classPrivateFieldGet(_this, _mediaChunks).length
|
|
2402
|
+
});
|
|
2403
|
+
return;
|
|
2404
|
+
}
|
|
2136
2405
|
_classPrivateFieldSet(_this, _dataReceiving, true);
|
|
2137
2406
|
_classPrivateFieldGet(_this, _mediaChunks).push(data);
|
|
2407
|
+
var totalBytes = _classPrivateFieldGet(_this, _mediaChunks).reduce(function (sum, chunk) {
|
|
2408
|
+
var _chunk$size;
|
|
2409
|
+
return sum + ((_chunk$size = chunk === null || chunk === void 0 ? void 0 : chunk.size) !== null && _chunk$size !== void 0 ? _chunk$size : 0);
|
|
2410
|
+
}, 0);
|
|
2411
|
+
_classPrivateFieldGet(_this, _logger).info("ondataavailable -> chunk received", {
|
|
2412
|
+
chunkBytes: data.size,
|
|
2413
|
+
chunkType: data.type,
|
|
2414
|
+
chunkCount: _classPrivateFieldGet(_this, _mediaChunks).length,
|
|
2415
|
+
totalBytes: totalBytes,
|
|
2416
|
+
recorderState: (_classPrivateFieldGet17 = _classPrivateFieldGet(_this, _mediaRecorder)) === null || _classPrivateFieldGet17 === void 0 ? void 0 : _classPrivateFieldGet17.state
|
|
2417
|
+
});
|
|
2138
2418
|
_classPrivateFieldGet(_this, _fireCallbacks).call(_this, SCREEN_RECORDER_EVENT.onDataAvailable, [data]);
|
|
2139
2419
|
}
|
|
2140
2420
|
});
|
|
2141
2421
|
_classPrivateFieldInitSpec(this, _onRecordingStop, {
|
|
2142
2422
|
writable: true,
|
|
2143
2423
|
value: function value() {
|
|
2144
|
-
|
|
2424
|
+
var _classPrivateFieldGet18, _classPrivateFieldGet19;
|
|
2425
|
+
var totalBytes = _classPrivateFieldGet(_this, _mediaChunks).reduce(function (sum, chunk) {
|
|
2426
|
+
var _chunk$size2;
|
|
2427
|
+
return sum + ((_chunk$size2 = chunk === null || chunk === void 0 ? void 0 : chunk.size) !== null && _chunk$size2 !== void 0 ? _chunk$size2 : 0);
|
|
2428
|
+
}, 0);
|
|
2429
|
+
_classPrivateFieldGet(_this, _logger).info("MediaRecorder.onstop fired", _objectSpread(_objectSpread({}, _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this)), {}, {
|
|
2430
|
+
totalBytes: totalBytes,
|
|
2431
|
+
mediaStreamActive: (_classPrivateFieldGet18 = _classPrivateFieldGet(_this, _mediaStream)) === null || _classPrivateFieldGet18 === void 0 ? void 0 : _classPrivateFieldGet18.active
|
|
2432
|
+
}));
|
|
2145
2433
|
_classPrivateFieldGet(_this, _store).setState({
|
|
2146
2434
|
status: SCREEN_RECORDER_STATUS.stopped
|
|
2147
2435
|
});
|
|
@@ -2149,22 +2437,78 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
2149
2437
|
|
|
2150
2438
|
// If mediaStream is active after stopping mediaRecorder, then that means that
|
|
2151
2439
|
// we are restarting and not stopping.
|
|
2152
|
-
if (_classPrivateFieldGet(_this, _mediaStream).active) {
|
|
2440
|
+
if ((_classPrivateFieldGet19 = _classPrivateFieldGet(_this, _mediaStream)) !== null && _classPrivateFieldGet19 !== void 0 && _classPrivateFieldGet19.active) {
|
|
2441
|
+
_classPrivateFieldGet(_this, _logger).info("onRecordingStop -> mediaStream still active, transitioning to restarting");
|
|
2153
2442
|
_classPrivateFieldGet(_this, _store).setState({
|
|
2154
2443
|
status: SCREEN_RECORDER_STATUS.restarting
|
|
2155
2444
|
});
|
|
2156
2445
|
}
|
|
2157
2446
|
}
|
|
2158
2447
|
});
|
|
2448
|
+
_classPrivateFieldInitSpec(this, _serializeError, {
|
|
2449
|
+
writable: true,
|
|
2450
|
+
value: function value(error) {
|
|
2451
|
+
if (!error) return {
|
|
2452
|
+
error: null
|
|
2453
|
+
};
|
|
2454
|
+
return {
|
|
2455
|
+
name: error.name,
|
|
2456
|
+
message: error.message,
|
|
2457
|
+
stack: error.stack,
|
|
2458
|
+
code: error.code,
|
|
2459
|
+
constraint: error.constraint
|
|
2460
|
+
};
|
|
2461
|
+
}
|
|
2462
|
+
});
|
|
2463
|
+
_classPrivateFieldInitSpec(this, _summarizeStream, {
|
|
2464
|
+
writable: true,
|
|
2465
|
+
value: function value(stream) {
|
|
2466
|
+
var _stream$getVideoTrack, _stream$getVideoTrack2, _stream$getAudioTrack, _stream$getAudioTrack2;
|
|
2467
|
+
if (!stream) return null;
|
|
2468
|
+
var summarizeTrack = function summarizeTrack(track) {
|
|
2469
|
+
return {
|
|
2470
|
+
kind: track.kind,
|
|
2471
|
+
readyState: track.readyState,
|
|
2472
|
+
enabled: track.enabled,
|
|
2473
|
+
muted: track.muted,
|
|
2474
|
+
label: track.label,
|
|
2475
|
+
settings: typeof track.getSettings === "function" ? track.getSettings() : undefined
|
|
2476
|
+
};
|
|
2477
|
+
};
|
|
2478
|
+
return {
|
|
2479
|
+
id: stream.id,
|
|
2480
|
+
active: stream.active,
|
|
2481
|
+
videoTracks: (_stream$getVideoTrack = (_stream$getVideoTrack2 = stream.getVideoTracks) === null || _stream$getVideoTrack2 === void 0 ? void 0 : _stream$getVideoTrack2.call(stream).map(summarizeTrack)) !== null && _stream$getVideoTrack !== void 0 ? _stream$getVideoTrack : [],
|
|
2482
|
+
audioTracks: (_stream$getAudioTrack = (_stream$getAudioTrack2 = stream.getAudioTracks) === null || _stream$getAudioTrack2 === void 0 ? void 0 : _stream$getAudioTrack2.call(stream).map(summarizeTrack)) !== null && _stream$getAudioTrack !== void 0 ? _stream$getAudioTrack : []
|
|
2483
|
+
};
|
|
2484
|
+
}
|
|
2485
|
+
});
|
|
2486
|
+
_classPrivateFieldInitSpec(this, _summarizeRecorderState, {
|
|
2487
|
+
writable: true,
|
|
2488
|
+
value: function value() {
|
|
2489
|
+
var _classPrivateFieldGet20;
|
|
2490
|
+
var extra = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2491
|
+
return _objectSpread({
|
|
2492
|
+
recorderState: (_classPrivateFieldGet20 = _classPrivateFieldGet(_this, _mediaRecorder)) === null || _classPrivateFieldGet20 === void 0 ? void 0 : _classPrivateFieldGet20.state,
|
|
2493
|
+
status: _classPrivateFieldGet(_this, _store).getState().status,
|
|
2494
|
+
elapsedTime: _classPrivateFieldGet(_this, _store).getState().elapsedTime,
|
|
2495
|
+
chunkCount: _classPrivateFieldGet(_this, _mediaChunks).length,
|
|
2496
|
+
dataReceiving: _classPrivateFieldGet(_this, _dataReceiving),
|
|
2497
|
+
countdownTimeLeft: _classPrivateFieldGet(_this, _store).getState().countdownTimeLeft
|
|
2498
|
+
}, extra);
|
|
2499
|
+
}
|
|
2500
|
+
});
|
|
2159
2501
|
_classPrivateFieldInitSpec(this, _startMediaRecorder, {
|
|
2160
2502
|
writable: true,
|
|
2161
2503
|
value: function value() {
|
|
2504
|
+
_classPrivateFieldGet(_this, _logger).info("startMediaRecorder -> scheduled", _objectSpread({
|
|
2505
|
+
delayMs: HALF_A_SECOND_IN_MILLISECONDS
|
|
2506
|
+
}, _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this)));
|
|
2162
2507
|
_classPrivateFieldSet(_this, _startRecordingTimeoutID, setTimeout(function () {
|
|
2163
2508
|
try {
|
|
2164
|
-
var
|
|
2165
|
-
_classPrivateFieldGet(_this, _logger).info("starting mediaRecorder");
|
|
2509
|
+
var _classPrivateFieldGet21;
|
|
2166
2510
|
if (!_classPrivateFieldGet(_this, _mediaRecorder)) {
|
|
2167
|
-
_classPrivateFieldGet(_this, _logger).
|
|
2511
|
+
_classPrivateFieldGet(_this, _logger).error("startMediaRecorder -> aborted, mediaRecorder is null", _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this));
|
|
2168
2512
|
_classPrivateFieldGet(_this, _store).setState({
|
|
2169
2513
|
status: SCREEN_RECORDER_STATUS.idle,
|
|
2170
2514
|
error: SCREEN_RECORDER_ERROR.FailedToStart
|
|
@@ -2172,22 +2516,29 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
2172
2516
|
return;
|
|
2173
2517
|
}
|
|
2174
2518
|
if (!_classPrivateFieldGet(_this, _mediaStream) || isStreamEnded(_classPrivateFieldGet(_this, _mediaStream))) {
|
|
2175
|
-
_classPrivateFieldGet(_this, _logger).
|
|
2519
|
+
_classPrivateFieldGet(_this, _logger).error("startMediaRecorder -> aborted, media stream unavailable or ended", {
|
|
2520
|
+
hasMediaStream: Boolean(_classPrivateFieldGet(_this, _mediaStream)),
|
|
2521
|
+
isEnded: _classPrivateFieldGet(_this, _mediaStream) ? isStreamEnded(_classPrivateFieldGet(_this, _mediaStream)) : true,
|
|
2522
|
+
stream: _classPrivateFieldGet(_this, _summarizeStream).call(_this, _classPrivateFieldGet(_this, _mediaStream))
|
|
2523
|
+
});
|
|
2176
2524
|
_classPrivateFieldGet(_this, _store).setState({
|
|
2177
2525
|
status: SCREEN_RECORDER_STATUS.idle,
|
|
2178
2526
|
error: SCREEN_RECORDER_ERROR.FailedToStart
|
|
2179
2527
|
});
|
|
2180
2528
|
return;
|
|
2181
2529
|
}
|
|
2182
|
-
if (((
|
|
2183
|
-
_classPrivateFieldGet(_this, _logger).
|
|
2530
|
+
if (((_classPrivateFieldGet21 = _classPrivateFieldGet(_this, _mediaRecorder)) === null || _classPrivateFieldGet21 === void 0 ? void 0 : _classPrivateFieldGet21.state) === "recording") {
|
|
2531
|
+
_classPrivateFieldGet(_this, _logger).warn("startMediaRecorder -> mediaRecorder already recording, skipping", _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this));
|
|
2184
2532
|
return;
|
|
2185
2533
|
}
|
|
2534
|
+
_classPrivateFieldGet(_this, _logger).info("startMediaRecorder -> calling start()", _objectSpread({
|
|
2535
|
+
timesliceMs: 5000
|
|
2536
|
+
}, _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this)));
|
|
2186
2537
|
_classPrivateFieldGet(_this, _mediaRecorder).start(5000);
|
|
2187
|
-
_classPrivateFieldGet(_this, _logger).info("
|
|
2538
|
+
_classPrivateFieldGet(_this, _logger).info("startMediaRecorder -> start() returned", _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this));
|
|
2188
2539
|
_classPrivateFieldGet(_this, _startTimer).call(_this);
|
|
2189
2540
|
} catch (error) {
|
|
2190
|
-
_classPrivateFieldGet(_this, _logger).
|
|
2541
|
+
_classPrivateFieldGet(_this, _logger).error("startMediaRecorder -> failed", _classPrivateFieldGet(_this, _serializeError).call(_this, error), _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this));
|
|
2191
2542
|
_classPrivateFieldGet(_this, _store).setState({
|
|
2192
2543
|
status: SCREEN_RECORDER_STATUS.idle,
|
|
2193
2544
|
error: SCREEN_RECORDER_ERROR.FailedToStart
|
|
@@ -2213,7 +2564,14 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
2213
2564
|
_classPrivateFieldInitSpec(this, _startCountdown, {
|
|
2214
2565
|
writable: true,
|
|
2215
2566
|
value: function value() {
|
|
2216
|
-
if (_classPrivateFieldGet(_this, _countdownTimerId))
|
|
2567
|
+
if (_classPrivateFieldGet(_this, _countdownTimerId)) {
|
|
2568
|
+
_classPrivateFieldGet(_this, _logger).warn("startCountdown -> already running, ignoring", _classPrivateFieldGet(_this, _summarizeRecorderState).call(_this));
|
|
2569
|
+
return;
|
|
2570
|
+
}
|
|
2571
|
+
_classPrivateFieldGet(_this, _logger).info("startCountdown -> begin", {
|
|
2572
|
+
countdownTimeLeft: _classPrivateFieldGet(_this, _store).getState().countdownTimeLeft,
|
|
2573
|
+
playCountdownAudio: _classPrivateFieldGet(_this, _playCountdownAudio)
|
|
2574
|
+
});
|
|
2217
2575
|
_classPrivateFieldGet(_this, _fireCallbacks).call(_this, SCREEN_RECORDER_EVENT.onCountdownStart);
|
|
2218
2576
|
_classPrivateFieldSet(_this, _countdownTimerId, setInterval(function () {
|
|
2219
2577
|
var shouldBeep = false;
|
|
@@ -2221,6 +2579,9 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
2221
2579
|
var countdownTimeLeft = _ref3.countdownTimeLeft;
|
|
2222
2580
|
if (countdownTimeLeft - ONE_SECOND > 0) {
|
|
2223
2581
|
var next = countdownTimeLeft - ONE_SECOND;
|
|
2582
|
+
_classPrivateFieldGet(_this, _logger).info("startCountdown -> tick", {
|
|
2583
|
+
remaining: next
|
|
2584
|
+
});
|
|
2224
2585
|
_classPrivateFieldGet(_this, _fireCallbacks).call(_this, SCREEN_RECORDER_EVENT.onCountdown, [next]);
|
|
2225
2586
|
shouldBeep = true;
|
|
2226
2587
|
return {
|
|
@@ -2229,6 +2590,7 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
2229
2590
|
}
|
|
2230
2591
|
_classPrivateFieldGet(_this, _fireCallbacks).call(_this, SCREEN_RECORDER_EVENT.onCountdown, [0]);
|
|
2231
2592
|
setTimeout(function () {
|
|
2593
|
+
_classPrivateFieldGet(_this, _logger).info("startCountdown -> end, starting recorder");
|
|
2232
2594
|
if (_classPrivateFieldGet(_this, _playCountdownAudio)) _classPrivateFieldGet(_this, _startRecordingAudio).play();
|
|
2233
2595
|
_classPrivateFieldGet(_this, _fireCallbacks).call(_this, SCREEN_RECORDER_EVENT.onCountdownEnd);
|
|
2234
2596
|
_classPrivateFieldGet(_this, _store).setState({
|
|
@@ -2280,12 +2642,22 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
2280
2642
|
var oneMinuteBeforeTimeLimit = _classPrivateFieldGet(_this, _timeLimit) - ONE_MINUTE_IN_MILLISECONDS;
|
|
2281
2643
|
if (elapsedTime <= oneMinuteBeforeTimeLimit) return;
|
|
2282
2644
|
if (elapsedTime < _classPrivateFieldGet(_this, _timeLimit) && elapsedTime > oneMinuteBeforeTimeLimit) {
|
|
2283
|
-
not(_classPrivateFieldGet(_this, _store).getState().showTimeLimitWarning)
|
|
2645
|
+
if (not(_classPrivateFieldGet(_this, _store).getState().showTimeLimitWarning)) {
|
|
2646
|
+
_classPrivateFieldGet(_this, _logger).info("time limit warning threshold crossed", {
|
|
2647
|
+
elapsedTime: elapsedTime,
|
|
2648
|
+
timeLimit: _classPrivateFieldGet(_this, _timeLimit)
|
|
2649
|
+
});
|
|
2650
|
+
_classPrivateFieldGet(_this, _recordingLimitWarningAudio).play();
|
|
2651
|
+
}
|
|
2284
2652
|
_classPrivateFieldGet(_this, _store).setState({
|
|
2285
2653
|
showTimeLimitWarning: true
|
|
2286
2654
|
});
|
|
2287
2655
|
return;
|
|
2288
2656
|
}
|
|
2657
|
+
_classPrivateFieldGet(_this, _logger).info("time limit reached, stopping recording", {
|
|
2658
|
+
elapsedTime: elapsedTime,
|
|
2659
|
+
timeLimit: _classPrivateFieldGet(_this, _timeLimit)
|
|
2660
|
+
});
|
|
2289
2661
|
_classPrivateFieldGet(_this, _stopRecordingDueToLimitReachedAudio).play();
|
|
2290
2662
|
_this.stopRecording();
|
|
2291
2663
|
}
|
|
@@ -2313,8 +2685,8 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
2313
2685
|
}, {
|
|
2314
2686
|
key: "displaySurface",
|
|
2315
2687
|
get: function get() {
|
|
2316
|
-
var
|
|
2317
|
-
var _ref5 = (
|
|
2688
|
+
var _classPrivateFieldGet22, _classPrivateFieldGet23;
|
|
2689
|
+
var _ref5 = (_classPrivateFieldGet22 = (_classPrivateFieldGet23 = _classPrivateFieldGet(this, _mediaStream)) === null || _classPrivateFieldGet23 === void 0 ? void 0 : _classPrivateFieldGet23.getVideoTracks()) !== null && _classPrivateFieldGet22 !== void 0 ? _classPrivateFieldGet22 : [],
|
|
2318
2690
|
_ref6 = _slicedToArray(_ref5, 1),
|
|
2319
2691
|
videoTrack = _ref6[0];
|
|
2320
2692
|
return videoTrack === null || videoTrack === void 0 ? void 0 : videoTrack.getSettings().displaySurface;
|