@bigbinary/neeto-media-recorder 1.3.20 → 1.3.21
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/README.md +4 -1
- package/index.js +20 -4
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/src/translations/en.json +4 -4
package/README.md
CHANGED
|
@@ -32,12 +32,15 @@ This package exports four different sets of functions and components.
|
|
|
32
32
|
import { MediaRecorder } from "@bigbinary/neeto-media-recorder";
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
`MediaRecorder` accepts
|
|
35
|
+
`MediaRecorder` accepts three props:
|
|
36
36
|
|
|
37
37
|
- `onUploadComplete`: This callback will get triggered once the uploading of
|
|
38
38
|
the screen recording is completed.
|
|
39
39
|
- `onDiscard`: This callback will get triggered whenever the user discard's
|
|
40
40
|
the screen recording.
|
|
41
|
+
- `appName`: This prop is used to set the application name which will be used
|
|
42
|
+
in the permission denied messages. By default it will be set to
|
|
43
|
+
`globalProps.appName`
|
|
41
44
|
|
|
42
45
|
### Utilities
|
|
43
46
|
|
package/index.js
CHANGED
|
@@ -6,7 +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 { Typography, Spinner, Button, Callout, Alert } from '@bigbinary/neetoui';
|
|
9
|
-
import { useTranslation } from 'react-i18next';
|
|
9
|
+
import { useTranslation, Trans } from 'react-i18next';
|
|
10
10
|
import { useMutation } from 'react-query';
|
|
11
11
|
import axios from 'axios';
|
|
12
12
|
import withT from '@bigbinary/neeto-commons-frontend/react-utils/withT';
|
|
@@ -1101,15 +1101,19 @@ var AllowMicAccess = function AllowMicAccess() {
|
|
|
1101
1101
|
})));
|
|
1102
1102
|
};
|
|
1103
1103
|
|
|
1104
|
+
var _window;
|
|
1104
1105
|
var useRecorderStore = screenRecorder.useRecorderStore,
|
|
1105
1106
|
restartRecording = screenRecorder.restartRecording,
|
|
1106
1107
|
discardRecording = screenRecorder.discardRecording;
|
|
1107
1108
|
var useMultipartS3UploadStore = multipartS3Uploader.useMultipartS3UploadStore;
|
|
1109
|
+
var globalProps = ((_window = window) === null || _window === void 0 ? void 0 : _window.globalProps) || {};
|
|
1108
1110
|
var MediaRecorder = function MediaRecorder(_ref, ref) {
|
|
1109
1111
|
var _ref$onUploadComplete = _ref.onUploadComplete,
|
|
1110
1112
|
onUploadComplete = _ref$onUploadComplete === void 0 ? noop : _ref$onUploadComplete,
|
|
1111
1113
|
_ref$onDiscard = _ref.onDiscard,
|
|
1112
|
-
onDiscard = _ref$onDiscard === void 0 ? noop : _ref$onDiscard
|
|
1114
|
+
onDiscard = _ref$onDiscard === void 0 ? noop : _ref$onDiscard,
|
|
1115
|
+
_ref$appName = _ref.appName,
|
|
1116
|
+
appName = _ref$appName === void 0 ? globalProps.appName : _ref$appName;
|
|
1113
1117
|
var _useTranslation = useTranslation(),
|
|
1114
1118
|
t = _useTranslation.t;
|
|
1115
1119
|
var _useState = useState(false),
|
|
@@ -1325,12 +1329,24 @@ var MediaRecorder = function MediaRecorder(_ref, ref) {
|
|
|
1325
1329
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
1326
1330
|
className: "mb-2",
|
|
1327
1331
|
style: "h3"
|
|
1328
|
-
}, t("neetoMediaRecorder.record.screenSharePermissionDeniedTitle"
|
|
1332
|
+
}, t("neetoMediaRecorder.record.screenSharePermissionDeniedTitle", {
|
|
1333
|
+
appName: appName
|
|
1334
|
+
})), /*#__PURE__*/React.createElement(Typography, null, /*#__PURE__*/React.createElement(Trans, {
|
|
1335
|
+
i18nKey: "neetoMediaRecorder.record.screenSharePermissionDenied",
|
|
1336
|
+
components: {
|
|
1337
|
+
Bold: /*#__PURE__*/React.createElement(Typography, {
|
|
1338
|
+
component: "span",
|
|
1339
|
+
weight: "bold"
|
|
1340
|
+
})
|
|
1341
|
+
}
|
|
1342
|
+
}))), error === SCREEN_RECORDER_ERROR.MicPermissionDenied && /*#__PURE__*/React.createElement("div", {
|
|
1329
1343
|
className: "flex flex-col items-center"
|
|
1330
1344
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
1331
1345
|
className: "mb-2",
|
|
1332
1346
|
style: "h3"
|
|
1333
|
-
}, t("neetoMediaRecorder.record.micPermissionDeniedTitle"
|
|
1347
|
+
}, t("neetoMediaRecorder.record.micPermissionDeniedTitle", {
|
|
1348
|
+
appName: appName
|
|
1349
|
+
})), /*#__PURE__*/React.createElement(Typography, null, t("neetoMediaRecorder.record.micPermissionDeniedMessage")), /*#__PURE__*/React.createElement(AllowMicAccess, null)), isRecorderStatus(SCREEN_RECORDER_STATUS.acquiring_media) && /*#__PURE__*/React.createElement(Callout, {
|
|
1334
1350
|
className: "mb-2 p-3",
|
|
1335
1351
|
"data-cy": "recorder-grant-permission-info-callout",
|
|
1336
1352
|
style: "info"
|