@bigbinary/neeto-media-recorder 2.1.6-beta.3 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/constants.js +2 -0
- package/constants.js.map +1 -1
- package/core.js +60 -52
- package/core.js.map +1 -1
- package/index.js +21 -2
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/src/translations/en.json +3 -1
package/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { SCREEN_RECORDER_STATUS, SCREEN_RECORDER_ERROR, IS_SAFARI_EXTENSION, UPL
|
|
|
6
6
|
import { screenRecorder, multipartS3Uploader } from '@bigbinary/neeto-media-recorder/core';
|
|
7
7
|
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
8
8
|
import Alert from '@bigbinary/neetoui/Alert';
|
|
9
|
+
import Button from '@bigbinary/neetoui/Button';
|
|
9
10
|
import Callout from '@bigbinary/neetoui/Callout';
|
|
10
11
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
11
12
|
import { useTranslation, Trans } from 'react-i18next';
|
|
@@ -18,7 +19,6 @@ import Computer from '@bigbinary/neeto-icons/Computer';
|
|
|
18
19
|
import Delete from '@bigbinary/neeto-icons/Delete';
|
|
19
20
|
import Pause from '@bigbinary/neeto-icons/Pause';
|
|
20
21
|
import Unlock from '@bigbinary/neeto-icons/Unlock';
|
|
21
|
-
import Button from '@bigbinary/neetoui/Button';
|
|
22
22
|
import platform from 'platform';
|
|
23
23
|
import { isNotNil, isEmpty } from 'ramda';
|
|
24
24
|
import { copyToClipboard } from '@bigbinary/neeto-commons-frontend/utils/general';
|
|
@@ -1362,6 +1362,8 @@ var MediaRecorder = function MediaRecorder(_ref, ref) {
|
|
|
1362
1362
|
var asyncCleanupFunc = useRef(null);
|
|
1363
1363
|
useEffect(function () {
|
|
1364
1364
|
if (error === SCREEN_RECORDER_ERROR.UnSupportedBrowser) return noop;
|
|
1365
|
+
if (error === SCREEN_RECORDER_ERROR.NotSupportedError) return noop;
|
|
1366
|
+
if (error === SCREEN_RECORDER_ERROR.InvalidStateError) return noop;
|
|
1365
1367
|
if (!isRecorderStatus(SCREEN_RECORDER_STATUS.idle) || error === SCREEN_RECORDER_ERROR.NotAllowedError || error === SCREEN_RECORDER_ERROR.MicPermissionDenied || IS_SAFARI_EXTENSION) {
|
|
1366
1368
|
if (error !== SCREEN_RECORDER_ERROR.MicPermissionDenied) return noop;
|
|
1367
1369
|
window.navigator.permissions.query({
|
|
@@ -1419,6 +1421,23 @@ var MediaRecorder = function MediaRecorder(_ref, ref) {
|
|
|
1419
1421
|
if (error === SCREEN_RECORDER_ERROR.UnSupportedBrowser) {
|
|
1420
1422
|
return /*#__PURE__*/jsx(UnSupportedBrowser, {});
|
|
1421
1423
|
}
|
|
1424
|
+
if (error === SCREEN_RECORDER_ERROR.NotSupportedError || error === SCREEN_RECORDER_ERROR.InvalidStateError) {
|
|
1425
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1426
|
+
className: "flex h-screen w-full flex-col items-center justify-center gap-4",
|
|
1427
|
+
children: [/*#__PURE__*/jsx(Callout, {
|
|
1428
|
+
className: "p-5",
|
|
1429
|
+
"data-cy": "recorder-unsupported-browser-callout",
|
|
1430
|
+
style: "danger",
|
|
1431
|
+
children: t("neetoMediaRecorder.notSupportedError")
|
|
1432
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
1433
|
+
label: t("neetoMediaRecorder.record.retry"),
|
|
1434
|
+
size: "large",
|
|
1435
|
+
onClick: function onClick() {
|
|
1436
|
+
return window.location.reload();
|
|
1437
|
+
}
|
|
1438
|
+
})]
|
|
1439
|
+
});
|
|
1440
|
+
}
|
|
1422
1441
|
if (isRecorderStatus(SCREEN_RECORDER_STATUS.stopped) && isUploadStatus(UPLOAD_STATUS.uploading)) {
|
|
1423
1442
|
return /*#__PURE__*/jsx(UploadingInProgress, {
|
|
1424
1443
|
recording: recording,
|
|
@@ -1489,7 +1508,7 @@ var MediaRecorder = function MediaRecorder(_ref, ref) {
|
|
|
1489
1508
|
duration: getRecorderTimeLimitInHumanFormat(screenRecorder.timeLimit)
|
|
1490
1509
|
})
|
|
1491
1510
|
}), isRecorderStatus(SCREEN_RECORDER_STATUS.media_acquired, SCREEN_RECORDER_STATUS.restarting) && /*#__PURE__*/jsxs("div", {
|
|
1492
|
-
className: "
|
|
1511
|
+
className: "mx-auto flex flex-col items-center justify-center space-y-4",
|
|
1493
1512
|
"data-cy": "recorder-countdown-wrapper",
|
|
1494
1513
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
1495
1514
|
style: "h3",
|