@bigbinary/neeto-media-recorder 1.3.0 → 1.3.2
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 +157 -123
- package/constants.js +3 -1
- package/constants.js.map +1 -1
- package/core.js +33 -2
- package/core.js.map +1 -1
- package/index.js +33 -21
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/src/translations/en.json +7 -6
package/README.md
CHANGED
|
@@ -18,108 +18,122 @@ This package exports four different sets of functions and components.
|
|
|
18
18
|
3. [Constants](#constants)
|
|
19
19
|
4. [Core](#core)
|
|
20
20
|
|
|
21
|
-
|
|
22
21
|
### Components
|
|
23
|
-
- #### MediaRecorder
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
- #### MediaRecorder
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
The `MediaRecorder` react component capture's device screen and upload it to
|
|
26
|
+
the AWS S3 storage. It contains UI controls to start, pause/resume, discard
|
|
27
|
+
and restart a recording.
|
|
28
|
+
|
|
29
|
+
You can import the components from `@bigbinary/neeto-media-recorder`.
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
import { MediaRecorder } from "@bigbinary/neeto-media-recorder";
|
|
33
|
+
```
|
|
31
34
|
|
|
32
|
-
|
|
35
|
+
`MediaRecorder` accepts two props:
|
|
33
36
|
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
- `onUploadComplete`: This callback will get triggered once the uploading of
|
|
38
|
+
the screen recording is completed.
|
|
39
|
+
- `onDiscard`: This callback will get triggered whenever the user discard's
|
|
40
|
+
the screen recording.
|
|
36
41
|
|
|
37
42
|
### Utilities
|
|
38
43
|
|
|
39
|
-
|
|
44
|
+
You can import utilities from `@bigbinary/neeto-media-recorder/utils`.
|
|
40
45
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
```js
|
|
47
|
+
import { generatePublicUrl } from "@bigbinary/neeto-media-recorder/utils";
|
|
48
|
+
```
|
|
44
49
|
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
- #### `generatePublicUrl(recordingId, baseURL = window.location.origin)`
|
|
51
|
+
Can be used to generate the public URL for a screen recording by providing the
|
|
52
|
+
`recordingId` and `baseURL` as arguments.
|
|
47
53
|
|
|
48
54
|
### Constants
|
|
49
55
|
|
|
50
|
-
|
|
51
|
-
```js
|
|
52
|
-
import { UPLOAD_EVENT, UPLOAD_STATUS,... } from "@bigbinary/neeto-media-recorder/constants"
|
|
53
|
-
```
|
|
56
|
+
You can import constants from `@bigbinary/neeto-media-recorder/constants`.
|
|
54
57
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
58
|
+
```js
|
|
59
|
+
import { UPLOAD_EVENT, UPLOAD_STATUS,... } from "@bigbinary/neeto-media-recorder/constants"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The available constants are:
|
|
63
|
+
|
|
64
|
+
```js
|
|
65
|
+
const UPLOAD_EVENT = { onComplete: "onComplete" };
|
|
66
|
+
|
|
67
|
+
const UPLOAD_STATUS = {
|
|
68
|
+
uploading: "uploading",
|
|
69
|
+
completed: "completed",
|
|
70
|
+
aborting: "aborting",
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const SCREEN_RECORDER_STATUS = {
|
|
74
|
+
media_aborted: "media_aborted",
|
|
75
|
+
permission_denied: "permission_denied",
|
|
76
|
+
no_specified_media_found: "no_specified_media_found",
|
|
77
|
+
media_in_use: "media_in_use",
|
|
78
|
+
invalid_media_constraints: "invalid_media_constraints",
|
|
79
|
+
no_chrome_flags_set: "no_chrome_flags_set",
|
|
80
|
+
recorder_error: "recorder_error",
|
|
81
|
+
idle: "idle",
|
|
82
|
+
acquiring_media: "acquiring_media",
|
|
83
|
+
media_acquired: "media_acquired",
|
|
84
|
+
restarting: "restarting",
|
|
85
|
+
recording: "recording",
|
|
86
|
+
stopping: "stopping",
|
|
87
|
+
stopped: "stopped",
|
|
88
|
+
paused: "paused",
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const SCREEN_RECORDER_ERROR = {
|
|
92
|
+
AbortError: "media_aborted",
|
|
93
|
+
NotAllowedError: "permission_denied",
|
|
94
|
+
NotFoundError: "no_specified_media_found",
|
|
95
|
+
NotReadableError: "media_in_use",
|
|
96
|
+
OverconstrainedError: "invalid_media_constraints",
|
|
97
|
+
TypeError: "no_chrome_flags_set",
|
|
98
|
+
None: "",
|
|
99
|
+
NoRecorder: "recorder_error",
|
|
100
|
+
UnSupportedBrowser: "unsupported_browser",
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const SCREEN_RECORDER_EVENT = {
|
|
104
|
+
onStart: "onStart",
|
|
105
|
+
onStop: "onStop",
|
|
106
|
+
onDiscard: "onDiscard",
|
|
107
|
+
onDataAvailable: "onDataAvailable",
|
|
108
|
+
onDiscardDuringCountdown: "onDiscardDuringCountdown",
|
|
109
|
+
onRestart: "onRestart",
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const HAS_CHROME_NAMESPACE = typeof chrome === "object";
|
|
113
|
+
|
|
114
|
+
const IS_EXTENSION = HAS_CHROME_NAMESPACE && isNotNil(chrome.extension);
|
|
115
|
+
|
|
116
|
+
const IS_SAFARI = platform.name === "Safari";
|
|
117
|
+
|
|
118
|
+
const IS_SAFARI_EXTENSION = IS_SAFARI && IS_EXTENSION;
|
|
119
|
+
```
|
|
112
120
|
|
|
113
121
|
### Core
|
|
114
122
|
|
|
115
|
-
The `@bigbinary/neeto-media-recorder/core` contains two singleton class's
|
|
123
|
+
The `@bigbinary/neeto-media-recorder/core` contains two singleton class's
|
|
124
|
+
`screenRecorder` and `multipartS3Uploader`.
|
|
116
125
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
126
|
+
```js
|
|
127
|
+
import {
|
|
128
|
+
screenRecorder,
|
|
129
|
+
multipartS3Uploader,
|
|
130
|
+
} from "@bigbinary/neeto-media-recorder/core";
|
|
131
|
+
```
|
|
120
132
|
|
|
121
133
|
- #### screenRecorder
|
|
122
|
-
|
|
134
|
+
|
|
135
|
+
It handles the screen and audio capturing process. The recordings are limited
|
|
136
|
+
to 45 minutes. The various methods provided by `screenRecorder` are:
|
|
123
137
|
|
|
124
138
|
- `startRecording()`
|
|
125
139
|
|
|
@@ -147,18 +161,27 @@ The `@bigbinary/neeto-media-recorder/core` contains two singleton class's `scree
|
|
|
147
161
|
|
|
148
162
|
- `addCallback(event, callback)`
|
|
149
163
|
|
|
150
|
-
Used to add callback function for a specific screen recording event. The
|
|
164
|
+
Used to add callback function for a specific screen recording event. The
|
|
165
|
+
constant `SCREEN_RECORDER_EVENT` contains all the possible screen recording
|
|
166
|
+
events.
|
|
151
167
|
|
|
152
168
|
```js
|
|
153
|
-
screenRecorder.addCallback(
|
|
169
|
+
screenRecorder.addCallback(
|
|
170
|
+
SCREEN_RECORDER_EVENT.onStart,
|
|
171
|
+
handleStartRecording
|
|
172
|
+
);
|
|
154
173
|
```
|
|
155
174
|
|
|
156
175
|
- `removeCallback(event, callback)`
|
|
157
176
|
|
|
158
|
-
Used to remove an already added callback by providing the event and callback
|
|
177
|
+
Used to remove an already added callback by providing the event and callback
|
|
178
|
+
to be removed.
|
|
159
179
|
|
|
160
180
|
```js
|
|
161
|
-
screenRecorder.removeCallback(
|
|
181
|
+
screenRecorder.removeCallback(
|
|
182
|
+
SCREEN_RECORDER_EVENT.onStart,
|
|
183
|
+
handleStartRecording
|
|
184
|
+
);
|
|
162
185
|
```
|
|
163
186
|
|
|
164
187
|
- `removeAllCallbacksByEvent(event)`
|
|
@@ -166,7 +189,7 @@ The `@bigbinary/neeto-media-recorder/core` contains two singleton class's `scree
|
|
|
166
189
|
Used to remove all callbacks associated with a particular event.
|
|
167
190
|
|
|
168
191
|
```js
|
|
169
|
-
screenRecorder.removeCallback(SCREEN_RECORDER_EVENT.onStart)
|
|
192
|
+
screenRecorder.removeCallback(SCREEN_RECORDER_EVENT.onStart);
|
|
170
193
|
```
|
|
171
194
|
|
|
172
195
|
- `resetState()`
|
|
@@ -179,46 +202,56 @@ The `@bigbinary/neeto-media-recorder/core` contains two singleton class's `scree
|
|
|
179
202
|
|
|
180
203
|
- `useRecorderStore()`
|
|
181
204
|
|
|
182
|
-
A zustand store which can be used know the screenRecorder status and error
|
|
205
|
+
A zustand store which can be used know the screenRecorder status and error
|
|
206
|
+
if any occurred inside a react component
|
|
183
207
|
|
|
184
|
-
- `setAudioConfiguration({ deviceId, ...})`
|
|
185
|
-
|
|
186
|
-
|
|
208
|
+
- `setAudioConfiguration({ deviceId, ...})` Used to set the configuration for
|
|
209
|
+
the audio device. Ref:
|
|
210
|
+
https://w3c.github.io/mediacapture-main/#dom-mediatracksupportedconstraints
|
|
187
211
|
|
|
188
212
|
- #### multipartS3Uploader
|
|
189
|
-
It handles the upload of recorded screen data to AWS S3 storage. `multipartS3Uploader` provides the ability to upload the recording to S3 in multiple chunks. The methods provided `multipartS3Uploader` are:
|
|
190
213
|
|
|
191
|
-
|
|
214
|
+
It handles the upload of recorded screen data to AWS S3 storage.
|
|
215
|
+
`multipartS3Uploader` provides the ability to upload the recording to S3 in
|
|
216
|
+
multiple chunks. The methods provided `multipartS3Uploader` are:
|
|
217
|
+
|
|
218
|
+
- `initialize(recordingId, uploadId)`
|
|
192
219
|
|
|
193
|
-
|
|
220
|
+
Used to initialize the `multipartS3Uploader` by providing the `recordingId`
|
|
221
|
+
and `uploadId`. `recordingId` and `uploadId` can be obtained by creating a
|
|
222
|
+
new recording in `neeto-record-web`.
|
|
194
223
|
|
|
195
|
-
|
|
224
|
+
- `push(data)`
|
|
196
225
|
|
|
197
|
-
|
|
226
|
+
Used to upload the recorded chunk to S3.
|
|
198
227
|
|
|
199
|
-
|
|
228
|
+
- `completeUpload()`
|
|
200
229
|
|
|
201
|
-
|
|
230
|
+
Once the recording is completed this method should be called to mark the
|
|
231
|
+
recording as completed.
|
|
202
232
|
|
|
203
|
-
|
|
233
|
+
- `abortUpload()`
|
|
204
234
|
|
|
205
|
-
|
|
235
|
+
Used to discard the partially uploaded recording.
|
|
206
236
|
|
|
207
|
-
|
|
237
|
+
- `resetState()`
|
|
208
238
|
|
|
209
|
-
|
|
239
|
+
Used to reset the internal state of multipartS3Uploader to initial state.
|
|
210
240
|
|
|
211
|
-
|
|
241
|
+
- `addCallback(event, callback)`
|
|
212
242
|
|
|
213
|
-
|
|
243
|
+
Used to add callback function to a specific upload event. The constant
|
|
244
|
+
`UPLOAD_EVENT` contains all the possible upload events.
|
|
214
245
|
|
|
215
|
-
|
|
246
|
+
- `removeCallback(event, callback)`
|
|
216
247
|
|
|
217
|
-
|
|
248
|
+
Used to remove an already added callback by providing the event and callback
|
|
249
|
+
to be removed.
|
|
218
250
|
|
|
219
|
-
|
|
251
|
+
- `useMultipartS3UploadStore()`
|
|
220
252
|
|
|
221
|
-
|
|
253
|
+
A zustand store which can be used know the screenRecorder status inside a
|
|
254
|
+
react component.
|
|
222
255
|
|
|
223
256
|
## Development
|
|
224
257
|
|
|
@@ -234,24 +267,25 @@ yarn install
|
|
|
234
267
|
2. Run `yarn install` to download the dependencies and setup the development
|
|
235
268
|
environment.
|
|
236
269
|
3. Have a host application ready.
|
|
237
|
-
4. Run `yarn watch` to automatically transpile code as you save the
|
|
238
|
-
|
|
270
|
+
4. Run `yarn watch` to automatically transpile code as you save the file. You
|
|
271
|
+
can run `yarn build` if you want to run the build only once.
|
|
239
272
|
5. In a different terminal, run `yalc publish` to publish the
|
|
240
273
|
neeto-media-recorder to the local yalc store.
|
|
241
274
|
6. Run `yalc add @bigbinary/neeto-media-recorder` to install the
|
|
242
275
|
neeto-media-recorder to the host application.
|
|
243
|
-
7. After making necessary changes to `neeto-media-recorder`, run
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
8. Video explanation on how to use yalc:
|
|
276
|
+
7. After making necessary changes to `neeto-media-recorder`, run `yarn release`
|
|
277
|
+
to push the changes to the host application (assuming that you are in watch
|
|
278
|
+
mode and the changes are bundled automatically). Restart webpack-dev-server
|
|
279
|
+
in host if changes are not applied.
|
|
280
|
+
8. Video explanation on how to use yalc:
|
|
281
|
+
https://www.youtube.com/watch?v=QBiYGP0Rhe0
|
|
248
282
|
|
|
249
283
|
# Building and releasing.
|
|
250
284
|
|
|
251
|
-
The `@bigbinary/neeto-neeto-media-recorder` package gets published to NPM when
|
|
252
|
-
PR with `patch`, `minor` or `major` label to the `main` branch. The
|
|
253
|
-
label is used for bug fixes, `minor` label is used for new features and
|
|
254
|
-
label is used for breaking changes. You can checkout the
|
|
285
|
+
The `@bigbinary/neeto-neeto-media-recorder` package gets published to NPM when
|
|
286
|
+
we merge a PR with `patch`, `minor` or `major` label to the `main` branch. The
|
|
287
|
+
`patch` label is used for bug fixes, `minor` label is used for new features and
|
|
288
|
+
`major` label is used for breaking changes. You can checkout the
|
|
255
289
|
`Create and publish releases` workflow in GitHub Actions to get a live update.
|
|
256
290
|
|
|
257
291
|
In case if you missed to add the label, you can manually publish the package.
|
|
@@ -269,7 +303,7 @@ manager.
|
|
|
269
303
|
|
|
270
304
|
# Project integrations
|
|
271
305
|
|
|
272
|
-
|
|
|
273
|
-
|
|
274
|
-
|
|
|
275
|
-
| neeto-record-chrome-extension |
|
|
306
|
+
| Projects | neeto-media-recorder |
|
|
307
|
+
| :---------------------------: | :------------------: |
|
|
308
|
+
| neeto-record-web | :white_check_mark: |
|
|
309
|
+
| neeto-record-chrome-extension | :white_check_mark: |
|
package/constants.js
CHANGED
|
@@ -82,6 +82,8 @@ var MIME_TYPE = {
|
|
|
82
82
|
mp4: "video/mp4",
|
|
83
83
|
webmH264: "video/webm;codecs=h264"
|
|
84
84
|
};
|
|
85
|
+
var START_RECORDING_SOUND = "https://neeto-record-static-assets.s3.amazonaws.com/recording-start-sound.mp3";
|
|
86
|
+
var STOP_RECORDING_DUE_TO_LIMIT_REACHED_SOUND = "https://neeto-record-static-assets.s3.amazonaws.com/recording-end-sound.mp3";
|
|
85
87
|
|
|
86
|
-
export { DEFAULT_RETRY_CONFIG, HAS_CHROME_NAMESPACE, INITIAL_RETRY_DELAY, IS_EXTENSION, IS_SAFARI, IS_SAFARI_EXTENSION, MAX_RETRY_DELAY, MIME_TYPE, NETWORK_ERROR, ONE_MINUTE_IN_MILLISECONDS, ONE_SECOND, ONE_SECOND_IN_MILLISECONDS, PERMISSIONS_HELP_DOC, RETRIABLE_ERRORS, SCREEN_RECORDER_ERROR, SCREEN_RECORDER_EVENT, SCREEN_RECORDER_STATUS, TIMEOUT_ERROR, TOTAL_RETRIES, UPLOAD_EVENT, UPLOAD_STATUS };
|
|
88
|
+
export { DEFAULT_RETRY_CONFIG, HAS_CHROME_NAMESPACE, INITIAL_RETRY_DELAY, IS_EXTENSION, IS_SAFARI, IS_SAFARI_EXTENSION, MAX_RETRY_DELAY, MIME_TYPE, NETWORK_ERROR, ONE_MINUTE_IN_MILLISECONDS, ONE_SECOND, ONE_SECOND_IN_MILLISECONDS, PERMISSIONS_HELP_DOC, RETRIABLE_ERRORS, SCREEN_RECORDER_ERROR, SCREEN_RECORDER_EVENT, SCREEN_RECORDER_STATUS, START_RECORDING_SOUND, STOP_RECORDING_DUE_TO_LIMIT_REACHED_SOUND, TIMEOUT_ERROR, TOTAL_RETRIES, UPLOAD_EVENT, UPLOAD_STATUS };
|
|
87
89
|
//# sourceMappingURL=constants.js.map
|
package/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["node_modules/@babel/runtime/helpers/esm/typeof.js","src/constants.js"],"sourcesContent":["export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import platform from \"platform\";\nimport { isNotNil } from \"ramda\";\n\n// https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList\nexport const RETRIABLE_ERRORS = [500, 503];\n\nexport const ONE_SECOND_IN_MILLISECONDS = 1000;\n\nexport const ONE_MINUTE_IN_MILLISECONDS = 60 * ONE_SECOND_IN_MILLISECONDS;\n\nexport const ONE_SECOND = 1;\n\nexport const UPLOAD_EVENT = { onComplete: \"onComplete\" };\n\nexport const UPLOAD_STATUS = {\n uploading: \"uploading\",\n completed: \"completed\",\n aborting: \"aborting\",\n};\n\nexport const SCREEN_RECORDER_STATUS = {\n media_aborted: \"media_aborted\",\n permission_denied: \"permission_denied\",\n no_specified_media_found: \"no_specified_media_found\",\n media_in_use: \"media_in_use\",\n invalid_media_constraints: \"invalid_media_constraints\",\n no_chrome_flags_set: \"no_chrome_flags_set\",\n recorder_error: \"recorder_error\",\n idle: \"idle\",\n acquiring_media: \"acquiring_media\",\n media_acquired: \"media_acquired\",\n restarting: \"restarting\",\n recording: \"recording\",\n stopping: \"stopping\",\n stopped: \"stopped\",\n paused: \"paused\",\n};\n\nexport const SCREEN_RECORDER_ERROR = {\n AbortError: \"media_aborted\",\n NotAllowedError: \"permission_denied\",\n NotFoundError: \"no_specified_media_found\",\n NotReadableError: \"media_in_use\",\n OverconstrainedError: \"invalid_media_constraints\",\n TypeError: \"no_chrome_flags_set\",\n None: \"\",\n NoRecorder: \"recorder_error\",\n UnSupportedBrowser: \"unsupported_browser\",\n};\n\nexport const SCREEN_RECORDER_EVENT = {\n onStart: \"onStart\",\n onStop: \"onStop\",\n onDiscard: \"onDiscard\",\n onDataAvailable: \"onDataAvailable\",\n onDiscardDuringCountdown: \"onDiscardDuringCountdown\",\n onRestart: \"onRestart\",\n};\n\nexport const TOTAL_RETRIES = 30;\nexport const INITIAL_RETRY_DELAY = 4000;\nexport const MAX_RETRY_DELAY = 16000;\n\nexport const DEFAULT_RETRY_CONFIG = {\n retries: TOTAL_RETRIES,\n retryDelay: INITIAL_RETRY_DELAY,\n retryableStatuses: [],\n};\n\n// No need to localize this since it will only be used in the code\n// eslint-disable-next-line @bigbinary/neeto/hard-coded-strings-should-be-localized\nexport const NETWORK_ERROR = \"Network Error\";\nexport const TIMEOUT_ERROR = \"ECONNABORTED\";\n\nexport const HAS_CHROME_NAMESPACE = typeof chrome === \"object\";\n\nexport const IS_EXTENSION = HAS_CHROME_NAMESPACE && isNotNil(chrome.extension);\n\nexport const IS_SAFARI = platform.name === \"Safari\";\n\nexport const IS_SAFARI_EXTENSION = IS_SAFARI && IS_EXTENSION;\n\nexport const PERMISSIONS_HELP_DOC =\n \"https://neetorecordhelp.neetokb.com/p/a-10efcfd7\";\n\nexport const MIME_TYPE = {\n mp4: \"video/mp4\",\n webmH264: \"video/webm;codecs=h264\",\n};\n"],"names":["RETRIABLE_ERRORS","ONE_SECOND_IN_MILLISECONDS","ONE_MINUTE_IN_MILLISECONDS","ONE_SECOND","UPLOAD_EVENT","onComplete","UPLOAD_STATUS","uploading","completed","aborting","SCREEN_RECORDER_STATUS","media_aborted","permission_denied","no_specified_media_found","media_in_use","invalid_media_constraints","no_chrome_flags_set","recorder_error","idle","acquiring_media","media_acquired","restarting","recording","stopping","stopped","paused","SCREEN_RECORDER_ERROR","AbortError","NotAllowedError","NotFoundError","NotReadableError","OverconstrainedError","TypeError","None","NoRecorder","UnSupportedBrowser","SCREEN_RECORDER_EVENT","onStart","onStop","onDiscard","onDataAvailable","onDiscardDuringCountdown","onRestart","TOTAL_RETRIES","INITIAL_RETRY_DELAY","MAX_RETRY_DELAY","DEFAULT_RETRY_CONFIG","retries","retryDelay","retryableStatuses","NETWORK_ERROR","TIMEOUT_ERROR","HAS_CHROME_NAMESPACE","chrome","_typeof","IS_EXTENSION","isNotNil","extension","IS_SAFARI","platform","name","IS_SAFARI_EXTENSION","PERMISSIONS_HELP_DOC","MIME_TYPE","mp4","webmH264"],"mappings":";;;AAAe,SAAS,OAAO,CAAC,GAAG,EAAE;AACrC,EAAE,yBAAyB,CAAC;AAC5B;AACA,EAAE,OAAO,OAAO,GAAG,UAAU,IAAI,OAAO,MAAM,IAAI,QAAQ,IAAI,OAAO,MAAM,CAAC,QAAQ,GAAG,UAAU,GAAG,EAAE;AACtG,IAAI,OAAO,OAAO,GAAG,CAAC;AACtB,GAAG,GAAG,UAAU,GAAG,EAAE;AACrB,IAAI,OAAO,GAAG,IAAI,UAAU,IAAI,OAAO,MAAM,IAAI,GAAG,CAAC,WAAW,KAAK,MAAM,IAAI,GAAG,KAAK,MAAM,CAAC,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,CAAC;AAChI,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;AAClB;;ACLA;IACaA,gBAAgB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAC;AAEnC,IAAMC,0BAA0B,GAAG,KAAI;AAEjCC,IAAAA,0BAA0B,GAAG,EAAE,GAAGD,2BAA0B;AAElE,IAAME,UAAU,GAAG,EAAC;AAEpB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,WAAW;AACtBC,EAAAA,eAAe,EAAE,iBAAiB;AAClCC,EAAAA,wBAAwB,EAAE,0BAA0B;AACpDC,EAAAA,SAAS,EAAE,WAAA;AACb,EAAC;AAEM,IAAMC,aAAa,GAAG,GAAE;AACxB,IAAMC,mBAAmB,GAAG,KAAI;AAChC,IAAMC,eAAe,GAAG,MAAK;AAE7B,IAAMC,oBAAoB,GAAG;AAClCC,EAAAA,OAAO,EAAEJ,aAAa;AACtBK,EAAAA,UAAU,EAAEJ,mBAAmB;AAC/BK,EAAAA,iBAAiB,EAAE,EAAA;AACrB,EAAC;;AAED;AACA;AACO,IAAMC,aAAa,GAAG,gBAAe;AACrC,IAAMC,aAAa,GAAG,eAAc;AAEpC,IAAMC,oBAAoB,GAAG,CAAOC,OAAAA,MAAM,iCAAAC,OAAA,CAAND,MAAM,CAAA,MAAK,SAAQ;AAEvD,IAAME,YAAY,GAAGH,oBAAoB,IAAII,QAAQ,CAACH,MAAM,CAACI,SAAS,EAAC;IAEjEC,SAAS,GAAGC,QAAQ,CAACC,IAAI,KAAK,SAAQ;AAEtCC,IAAAA,mBAAmB,GAAGH,SAAS,IAAIH,aAAY;AAErD,IAAMO,oBAAoB,GAC/B,mDAAkD;AAE7C,IAAMC,SAAS,GAAG;AACvBC,EAAAA,GAAG,EAAE,WAAW;AAChBC,EAAAA,QAAQ,EAAE,wBAAA;AACZ;;;;"}
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["node_modules/@babel/runtime/helpers/esm/typeof.js","src/constants.js"],"sourcesContent":["export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import platform from \"platform\";\nimport { isNotNil } from \"ramda\";\n\n// https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList\nexport const RETRIABLE_ERRORS = [500, 503];\n\nexport const ONE_SECOND_IN_MILLISECONDS = 1000;\n\nexport const ONE_MINUTE_IN_MILLISECONDS = 60 * ONE_SECOND_IN_MILLISECONDS;\n\nexport const ONE_SECOND = 1;\n\nexport const UPLOAD_EVENT = { onComplete: \"onComplete\" };\n\nexport const UPLOAD_STATUS = {\n uploading: \"uploading\",\n completed: \"completed\",\n aborting: \"aborting\",\n};\n\nexport const SCREEN_RECORDER_STATUS = {\n media_aborted: \"media_aborted\",\n permission_denied: \"permission_denied\",\n no_specified_media_found: \"no_specified_media_found\",\n media_in_use: \"media_in_use\",\n invalid_media_constraints: \"invalid_media_constraints\",\n no_chrome_flags_set: \"no_chrome_flags_set\",\n recorder_error: \"recorder_error\",\n idle: \"idle\",\n acquiring_media: \"acquiring_media\",\n media_acquired: \"media_acquired\",\n restarting: \"restarting\",\n recording: \"recording\",\n stopping: \"stopping\",\n stopped: \"stopped\",\n paused: \"paused\",\n};\n\nexport const SCREEN_RECORDER_ERROR = {\n AbortError: \"media_aborted\",\n NotAllowedError: \"permission_denied\",\n NotFoundError: \"no_specified_media_found\",\n NotReadableError: \"media_in_use\",\n OverconstrainedError: \"invalid_media_constraints\",\n TypeError: \"no_chrome_flags_set\",\n None: \"\",\n NoRecorder: \"recorder_error\",\n UnSupportedBrowser: \"unsupported_browser\",\n};\n\nexport const SCREEN_RECORDER_EVENT = {\n onStart: \"onStart\",\n onStop: \"onStop\",\n onDiscard: \"onDiscard\",\n onDataAvailable: \"onDataAvailable\",\n onDiscardDuringCountdown: \"onDiscardDuringCountdown\",\n onRestart: \"onRestart\",\n};\n\nexport const TOTAL_RETRIES = 30;\nexport const INITIAL_RETRY_DELAY = 4000;\nexport const MAX_RETRY_DELAY = 16000;\n\nexport const DEFAULT_RETRY_CONFIG = {\n retries: TOTAL_RETRIES,\n retryDelay: INITIAL_RETRY_DELAY,\n retryableStatuses: [],\n};\n\n// No need to localize this since it will only be used in the code\n// eslint-disable-next-line @bigbinary/neeto/hard-coded-strings-should-be-localized\nexport const NETWORK_ERROR = \"Network Error\";\nexport const TIMEOUT_ERROR = \"ECONNABORTED\";\n\nexport const HAS_CHROME_NAMESPACE = typeof chrome === \"object\";\n\nexport const IS_EXTENSION = HAS_CHROME_NAMESPACE && isNotNil(chrome.extension);\n\nexport const IS_SAFARI = platform.name === \"Safari\";\n\nexport const IS_SAFARI_EXTENSION = IS_SAFARI && IS_EXTENSION;\n\nexport const PERMISSIONS_HELP_DOC =\n \"https://neetorecordhelp.neetokb.com/p/a-10efcfd7\";\n\nexport const MIME_TYPE = {\n mp4: \"video/mp4\",\n webmH264: \"video/webm;codecs=h264\",\n};\n\nexport const START_RECORDING_SOUND =\n \"https://neeto-record-static-assets.s3.amazonaws.com/recording-start-sound.mp3\";\n\nexport const STOP_RECORDING_DUE_TO_LIMIT_REACHED_SOUND =\n \"https://neeto-record-static-assets.s3.amazonaws.com/recording-end-sound.mp3\";\n"],"names":["RETRIABLE_ERRORS","ONE_SECOND_IN_MILLISECONDS","ONE_MINUTE_IN_MILLISECONDS","ONE_SECOND","UPLOAD_EVENT","onComplete","UPLOAD_STATUS","uploading","completed","aborting","SCREEN_RECORDER_STATUS","media_aborted","permission_denied","no_specified_media_found","media_in_use","invalid_media_constraints","no_chrome_flags_set","recorder_error","idle","acquiring_media","media_acquired","restarting","recording","stopping","stopped","paused","SCREEN_RECORDER_ERROR","AbortError","NotAllowedError","NotFoundError","NotReadableError","OverconstrainedError","TypeError","None","NoRecorder","UnSupportedBrowser","SCREEN_RECORDER_EVENT","onStart","onStop","onDiscard","onDataAvailable","onDiscardDuringCountdown","onRestart","TOTAL_RETRIES","INITIAL_RETRY_DELAY","MAX_RETRY_DELAY","DEFAULT_RETRY_CONFIG","retries","retryDelay","retryableStatuses","NETWORK_ERROR","TIMEOUT_ERROR","HAS_CHROME_NAMESPACE","chrome","_typeof","IS_EXTENSION","isNotNil","extension","IS_SAFARI","platform","name","IS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pC,IAAMC,oBAAoB,GAAG,CAAOC,OAAAA,MAAM,iCAAAC,OAAA,CAAND,MAAM,CAAA,MAAK,SAAQ;AAEvD,IAAME,YAAY,GAAGH,oBAAoB,IAAII,QAAQ,CAACH,MAAM,CAACI,SAAS,EAAC;IAEjEC,SAAS,GAAGC,QAAQ,CAACC,IAAI,KAAK,SAAQ;AAEtCC,IAAAA,mBAAmB,GAAGH,SAAS,IAAIH,aAAY;AAErD,IAAMO,oBAAoB,GAC/B,mDAAkD;AAE7C,IAAMC,SAAS,GAAG;AACvBC,EAAAA,GAAG,EAAE,WAAW;AAChBC,EAAAA,QAAQ,EAAE,wBAAA;AACZ,EAAC;AAEM,IAAMC,qBAAqB,GAChC,gFAA+E;AAE1E,IAAMC,yCAAyC,GACpD;;;;"}
|
package/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import { isPresent, isNot, existsBy, isNotEmpty } from '@bigbinary/neeto-cist';
|
|
3
|
-
import { RETRIABLE_ERRORS, UPLOAD_EVENT, UPLOAD_STATUS, SCREEN_RECORDER_STATUS, SCREEN_RECORDER_ERROR, SCREEN_RECORDER_EVENT, ONE_SECOND, ONE_SECOND_IN_MILLISECONDS } from '@bigbinary/neeto-media-recorder/constants';
|
|
3
|
+
import { RETRIABLE_ERRORS, UPLOAD_EVENT, UPLOAD_STATUS, SCREEN_RECORDER_STATUS, START_RECORDING_SOUND, SCREEN_RECORDER_ERROR, SCREEN_RECORDER_EVENT, ONE_SECOND, ONE_SECOND_IN_MILLISECONDS, STOP_RECORDING_DUE_TO_LIMIT_REACHED_SOUND } from '@bigbinary/neeto-media-recorder/constants';
|
|
4
4
|
import { isNotNil, min, identity, isEmpty, isNil, pick } from 'ramda';
|
|
5
5
|
import platform from 'platform';
|
|
6
6
|
import withImmutableActions from '@bigbinary/neeto-commons-frontend/react-utils/withImmutableActions';
|
|
@@ -1117,6 +1117,8 @@ var DISPLAY_SURFACE = {
|
|
|
1117
1117
|
window: "window",
|
|
1118
1118
|
browser: "browser"
|
|
1119
1119
|
};
|
|
1120
|
+
var RECORDING_TIME_LIMIT = 2700000; // 45 minutes
|
|
1121
|
+
var RECORDING_TIME_LIMIT_WARNING_TIME = 2400000; // 40 minutes
|
|
1120
1122
|
|
|
1121
1123
|
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1122
1124
|
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -1124,7 +1126,8 @@ var initialState = {
|
|
|
1124
1126
|
status: SCREEN_RECORDER_STATUS.idle,
|
|
1125
1127
|
error: "",
|
|
1126
1128
|
elapsedTime: 0,
|
|
1127
|
-
countdownTimeLeft: 3
|
|
1129
|
+
countdownTimeLeft: 3,
|
|
1130
|
+
showTimeLimitWarning: false
|
|
1128
1131
|
};
|
|
1129
1132
|
var prepareStore = function prepareStore() {
|
|
1130
1133
|
return create$3(withImmutableActions(function (set) {
|
|
@@ -1190,6 +1193,8 @@ var _callbacks = /*#__PURE__*/new WeakMap();
|
|
|
1190
1193
|
var _lastTimerUpdatedAt = /*#__PURE__*/new WeakMap();
|
|
1191
1194
|
var _timerId = /*#__PURE__*/new WeakMap();
|
|
1192
1195
|
var _countdownTimerId = /*#__PURE__*/new WeakMap();
|
|
1196
|
+
var _startRecordingAudio = /*#__PURE__*/new WeakMap();
|
|
1197
|
+
var _stopRecordingDueToLimitReachedAudio = /*#__PURE__*/new WeakMap();
|
|
1193
1198
|
var _checkCompatibility = /*#__PURE__*/new WeakMap();
|
|
1194
1199
|
var _acquireMediaStream = /*#__PURE__*/new WeakMap();
|
|
1195
1200
|
var _fireCallbacks = /*#__PURE__*/new WeakMap();
|
|
@@ -1199,6 +1204,7 @@ var _onRecordingStop = /*#__PURE__*/new WeakMap();
|
|
|
1199
1204
|
var _countdownAndStartRecording = /*#__PURE__*/new WeakMap();
|
|
1200
1205
|
var _startTimer = /*#__PURE__*/new WeakMap();
|
|
1201
1206
|
var _stopTimer = /*#__PURE__*/new WeakMap();
|
|
1207
|
+
var _checkIfTimeLimitReached = /*#__PURE__*/new WeakMap();
|
|
1202
1208
|
var ScreenRecorder = /*#__PURE__*/function () {
|
|
1203
1209
|
function ScreenRecorder(_audio2, video) {
|
|
1204
1210
|
var _this = this;
|
|
@@ -1243,6 +1249,14 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
1243
1249
|
writable: true,
|
|
1244
1250
|
value: void 0
|
|
1245
1251
|
});
|
|
1252
|
+
_classPrivateFieldInitSpec(this, _startRecordingAudio, {
|
|
1253
|
+
writable: true,
|
|
1254
|
+
value: new Audio(START_RECORDING_SOUND)
|
|
1255
|
+
});
|
|
1256
|
+
_classPrivateFieldInitSpec(this, _stopRecordingDueToLimitReachedAudio, {
|
|
1257
|
+
writable: true,
|
|
1258
|
+
value: void 0
|
|
1259
|
+
});
|
|
1246
1260
|
_defineProperty(this, "setAudioConfiguration", function (audio) {
|
|
1247
1261
|
return _classPrivateFieldSet(_this, _audio, audio);
|
|
1248
1262
|
});
|
|
@@ -1530,6 +1544,7 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
1530
1544
|
countdownTimeLeft: countdownTimeLeft - ONE_SECOND
|
|
1531
1545
|
};
|
|
1532
1546
|
}
|
|
1547
|
+
_classPrivateFieldGet(_this, _startRecordingAudio).play();
|
|
1533
1548
|
_classPrivateFieldGet(_this, _store).setState({
|
|
1534
1549
|
status: SCREEN_RECORDER_STATUS.recording
|
|
1535
1550
|
});
|
|
@@ -1553,6 +1568,7 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
1553
1568
|
var now = Date.now();
|
|
1554
1569
|
var newElapsedTime = elapsedTime + (now - _classPrivateFieldGet(_this, _lastTimerUpdatedAt));
|
|
1555
1570
|
_classPrivateFieldSet(_this, _lastTimerUpdatedAt, now);
|
|
1571
|
+
_classPrivateFieldGet(_this, _checkIfTimeLimitReached).call(_this, newElapsedTime);
|
|
1556
1572
|
return {
|
|
1557
1573
|
elapsedTime: newElapsedTime
|
|
1558
1574
|
};
|
|
@@ -1570,6 +1586,21 @@ var ScreenRecorder = /*#__PURE__*/function () {
|
|
|
1570
1586
|
});
|
|
1571
1587
|
}
|
|
1572
1588
|
});
|
|
1589
|
+
_classPrivateFieldInitSpec(this, _checkIfTimeLimitReached, {
|
|
1590
|
+
writable: true,
|
|
1591
|
+
value: function value(elapsedTime) {
|
|
1592
|
+
if (elapsedTime < RECORDING_TIME_LIMIT_WARNING_TIME) return;
|
|
1593
|
+
if (elapsedTime < RECORDING_TIME_LIMIT && elapsedTime > RECORDING_TIME_LIMIT_WARNING_TIME) {
|
|
1594
|
+
_classPrivateFieldGet(_this, _store).setState({
|
|
1595
|
+
showTimeLimitWarning: true
|
|
1596
|
+
});
|
|
1597
|
+
_classPrivateFieldSet(_this, _stopRecordingDueToLimitReachedAudio, new Audio(STOP_RECORDING_DUE_TO_LIMIT_REACHED_SOUND));
|
|
1598
|
+
return;
|
|
1599
|
+
}
|
|
1600
|
+
_classPrivateFieldGet(_this, _stopRecordingDueToLimitReachedAudio).play();
|
|
1601
|
+
_this.stopRecording();
|
|
1602
|
+
}
|
|
1603
|
+
});
|
|
1573
1604
|
_classPrivateFieldSet(this, _audio, _audio2);
|
|
1574
1605
|
_classPrivateFieldSet(this, _video, video);
|
|
1575
1606
|
_classPrivateFieldSet(this, _store, prepareStore());
|