@bigbinary/neeto-media-recorder 2.7.41 → 2.7.43

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-media-recorder",
3
- "version": "2.7.41",
3
+ "version": "2.7.43",
4
4
  "description": "A package to simplify the media capturing process",
5
5
  "repository": "git@github.com:bigbinary/neeto-media-recorder.git",
6
6
  "license": "MIT",
@@ -8,6 +8,9 @@
8
8
  ".": {
9
9
  "import": "./index.js"
10
10
  },
11
+ "./v2": {
12
+ "import": "./v2/index.js"
13
+ },
11
14
  "./constants": {
12
15
  "import": "./constants.js"
13
16
  },
@@ -28,13 +31,15 @@
28
31
  "release": "yarn build && yalc push --sig"
29
32
  },
30
33
  "engines": {
31
- "node": ">=18.12",
34
+ "node": ">=22.13",
32
35
  "npm": ">=9",
33
36
  "yarn": ">=1.22"
34
37
  },
35
38
  "files": [
36
39
  "index.js",
37
40
  "index.js.map",
41
+ "v2/index.js",
42
+ "v2/index.js.map",
38
43
  "constants.js",
39
44
  "constants.js.map",
40
45
  "core.js",
@@ -50,7 +55,7 @@
50
55
  },
51
56
  "devDependencies": {
52
57
  "@babel/core": "^7.19.1",
53
- "@babel/eslint-parser": "7.17.0",
58
+ "@babel/eslint-parser": "7.25.9",
54
59
  "@babel/generator": "^7.20.7",
55
60
  "@babel/plugin-transform-runtime": "^7.19.1",
56
61
  "@babel/preset-env": "7.17.10",
@@ -60,13 +65,17 @@
60
65
  "@babel/traverse": "^7.23.5",
61
66
  "@babel/types": "^7.20.7",
62
67
  "@bigbinary/babel-preset-neeto": "1.0.3",
63
- "@bigbinary/eslint-plugin-neeto": "1.1.39",
68
+ "@bigbinary/eslint-plugin-neeto": "1.8.0",
69
+ "@bigbinary/neeto-atoms": "^1.0.90",
64
70
  "@bigbinary/neeto-cist": "1.0.5",
65
- "@bigbinary/neeto-commons-frontend": "4.3.7",
71
+ "@bigbinary/neeto-commons-frontend": "4.13.138",
66
72
  "@bigbinary/neeto-icons": "1.17.6",
67
73
  "@bigbinary/neeto-media-recorder": "latest",
68
- "@bigbinary/neeto-molecules": "1.2.1",
74
+ "@bigbinary/neeto-molecules": "5.2.0",
69
75
  "@bigbinary/neetoui": "8.2.18",
76
+ "@eslint/compat": "^1.2.8",
77
+ "@eslint/eslintrc": "^3.3.1",
78
+ "@eslint/js": "^9.25.1",
70
79
  "@rollup/plugin-alias": "^3.1.9",
71
80
  "@rollup/plugin-babel": "^6.0.4",
72
81
  "@rollup/plugin-commonjs": "^25.0.5",
@@ -79,6 +88,7 @@
79
88
  "babel-plugin-dynamic-import-node": "^2.3.3",
80
89
  "babel-plugin-js-logger": "1.0.17",
81
90
  "babel-plugin-macros": "3.1.0",
91
+ "babel-plugin-module-resolver": "^5.0.2",
82
92
  "babel-plugin-preval": "^5.1.0",
83
93
  "babel-plugin-transform-imports": "^2.0.0",
84
94
  "babel-plugin-transform-react-remove-prop-types": "0.4.24",
@@ -86,19 +96,19 @@
86
96
  "babel-preset-typescript": "^7.0.0-alpha.19",
87
97
  "chrome-types": "^0.1.277",
88
98
  "classnames": "^2.3.2",
89
- "eslint": "8.14.0",
90
- "eslint-config-prettier": "8.5.0",
99
+ "eslint": "9.27.0",
100
+ "eslint-config-prettier": "^10.1.2",
91
101
  "eslint-plugin-cypress": "2.12.1",
92
- "eslint-plugin-import": "2.26.0",
93
- "eslint-plugin-jam3": "0.2.3",
94
- "eslint-plugin-json": "3.1.0",
95
- "eslint-plugin-prettier": "4.0.0",
96
- "eslint-plugin-promise": "6.0.0",
97
- "eslint-plugin-react": "7.29.4",
98
- "eslint-plugin-react-hooks": "4.5.0",
99
- "eslint-plugin-security": "^1.7.1",
100
- "eslint-plugin-sonarjs": "^0.21.0",
101
- "eslint-plugin-unused-imports": "2.0.0",
102
+ "eslint-plugin-import": "^2.31.0",
103
+ "eslint-plugin-jam3": "^0.2.3",
104
+ "eslint-plugin-json": "^4.0.1",
105
+ "eslint-plugin-prettier": "^5.2.6",
106
+ "eslint-plugin-promise": "^7.2.1",
107
+ "eslint-plugin-react": "^7.37.5",
108
+ "eslint-plugin-react-hooks": "^5.2.0",
109
+ "eslint-plugin-security": "^3.0.1",
110
+ "eslint-plugin-sonarjs": "^3.0.2",
111
+ "eslint-plugin-unused-imports": "^4.1.4",
102
112
  "eslint-plugin-xss": "^0.1.12",
103
113
  "husky": "^7.0.4",
104
114
  "i18next": "22.5.1",
@@ -120,15 +130,17 @@
120
130
  "rollup-plugin-styles": "^4.0.0",
121
131
  "sass": "^1.71.1",
122
132
  "tailwindcss": "^3.4.1",
133
+ "ts-api-utils": "^2.4.0",
123
134
  "uuid": "^11.0.2",
124
135
  "zustand": "4.3.2"
125
136
  },
126
137
  "peerDependencies": {
138
+ "@bigbinary/neeto-atoms": "^1.0.90",
127
139
  "@bigbinary/neeto-cist": "latest",
128
140
  "@bigbinary/neeto-commons-frontend": "latest",
129
141
  "@bigbinary/neeto-icons": "1.17.6",
130
142
  "@bigbinary/neeto-media-recorder": "latest",
131
- "@bigbinary/neeto-molecules": "1.1.69",
143
+ "@bigbinary/neeto-molecules": "5.2.0",
132
144
  "@bigbinary/neetoui": "8.2.18",
133
145
  "@tanstack/react-query": "5.40.0",
134
146
  "axios": "0.27.2",
@@ -142,5 +154,9 @@
142
154
  "react-router-dom": "5.3.1",
143
155
  "zustand": "4.3.2"
144
156
  },
157
+ "resolutions": {
158
+ "globals": "^16.0.0",
159
+ "@eslint/plugin-kit": ">=0.3.3"
160
+ },
145
161
  "packageManager": "yarn@1.22.22"
146
162
  }
@@ -0,0 +1,152 @@
1
+ import platform from "platform";
2
+ import { isNotNil } from "ramda";
3
+
4
+ import { HELP_DOCS_BASE_URL } from "./helpUrls";
5
+
6
+ // https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList
7
+ export const RETRYABLE_ERRORS = [500, 503];
8
+
9
+ export const ONE_SECOND_IN_MILLISECONDS = 1000;
10
+ export const HALF_A_SECOND_IN_MILLISECONDS = 500;
11
+ export const TWO_HUNDRED_MILLISECONDS = 200;
12
+
13
+ export const ONE_MINUTE_IN_MILLISECONDS = 60 * ONE_SECOND_IN_MILLISECONDS;
14
+ export const ONE_HOUR_IN_MILLISECONDS = 60 * ONE_MINUTE_IN_MILLISECONDS;
15
+
16
+ export const ONE_SECOND = 1;
17
+
18
+ export const COUNTDOWN_TIME = 3;
19
+
20
+ export const UPLOAD_EVENT = {
21
+ onComplete: "onComplete",
22
+ onError: "onError",
23
+ onProgress: "onProgress",
24
+ };
25
+
26
+ export const UPLOAD_STATUS = {
27
+ uploading: "uploading",
28
+ completed: "completed",
29
+ aborting: "aborting",
30
+ insufficient_data: "insufficient_data",
31
+ error: "error",
32
+ };
33
+
34
+ export const SCREEN_RECORDER_STATUS = {
35
+ media_aborted: "media_aborted",
36
+ permission_denied: "permission_denied",
37
+ no_specified_media_found: "no_specified_media_found",
38
+ media_in_use: "media_in_use",
39
+ invalid_media_constraints: "invalid_media_constraints",
40
+ no_chrome_flags_set: "no_chrome_flags_set",
41
+ recorder_error: "recorder_error",
42
+ idle: "idle",
43
+ acquiring_media: "acquiring_media",
44
+ media_acquired: "media_acquired",
45
+ restarting: "restarting",
46
+ recording: "recording",
47
+ stopping: "stopping",
48
+ stopped: "stopped",
49
+ paused: "paused",
50
+ };
51
+
52
+ export const SCREEN_RECORDER_ERROR = {
53
+ MicPermissionDenied: "mic_permission_denied",
54
+ AbortError: "media_aborted",
55
+ NotAllowedError: "permission_denied",
56
+ NotFoundError: "no_specified_media_found",
57
+ NotReadableError: "media_in_use",
58
+ OverconstrainedError: "invalid_media_constraints",
59
+ TypeError: "no_chrome_flags_set",
60
+ None: "",
61
+ NoRecorder: "recorder_error",
62
+ UnSupportedBrowser: "unsupported_browser",
63
+ FailedToStart: "failed_to_start",
64
+ CreateRecordingError: "create_recording_error",
65
+ InsufficientData: "insufficient_data",
66
+ };
67
+
68
+ export const SCREEN_RECORDER_EVENT = {
69
+ onStart: "onStart",
70
+ onStop: "onStop",
71
+ onDiscard: "onDiscard",
72
+ onDataAvailable: "onDataAvailable",
73
+ onDiscardDuringCountdown: "onDiscardDuringCountdown",
74
+ onRestart: "onRestart",
75
+ onReUpload: "onReUpload",
76
+ onReUploadFromDisk: "onReUploadFromDisk",
77
+ onPause: "onPause",
78
+ onResume: "onResume",
79
+ onCountdownStart: "onCountdownStart",
80
+ onCountdown: "onCountDown",
81
+ onCountdownEnd: "onCountdownEnd",
82
+ onCountdownSkip: "onCountdownSkip",
83
+ onShareSelected: "onShareSelected",
84
+ // Fired when the capture ends without the app calling stop() — i.e. the
85
+ // browser's "Stop sharing" pill or an OS-level termination (resource
86
+ // pressure, source closed, permission revoked). The two are
87
+ // indistinguishable in the Web/extension APIs, so consumers should surface
88
+ // both possibilities. If no consumer subscribes, the recorder falls back to
89
+ // finalizing the recording (stopRecording).
90
+ onUnexpectedEnd: "onUnexpectedEnd",
91
+ };
92
+
93
+ export const TOTAL_RETRIES = 15;
94
+ export const ABORT_UPLOAD_RETRIES = 2;
95
+ export const INITIAL_RETRY_DELAY = 4000;
96
+ export const MAX_RETRY_DELAY = 16000;
97
+
98
+ export const DEFAULT_RETRY_CONFIG = {
99
+ retries: TOTAL_RETRIES,
100
+ retryDelay: INITIAL_RETRY_DELAY,
101
+ retryableStatuses: [],
102
+ };
103
+
104
+ // No need to localize this since it will only be used in the code
105
+ // eslint-disable-next-line @bigbinary/neeto/hard-coded-strings-should-be-localized
106
+ export const NETWORK_ERROR = "Network Error";
107
+ export const TIMEOUT_ERROR = "ECONNABORTED";
108
+
109
+ export const HAS_CHROME_NAMESPACE = typeof chrome === "object";
110
+
111
+ export const IS_EXTENSION = HAS_CHROME_NAMESPACE && isNotNil(chrome.extension);
112
+
113
+ export const IS_SAFARI = platform.name === "Safari";
114
+
115
+ export const IS_SAFARI_EXTENSION = IS_SAFARI && IS_EXTENSION;
116
+
117
+ export const PERMISSIONS_HELP_DOC = `${HELP_DOCS_BASE_URL}/p/a-10efcfd7`;
118
+
119
+ // Firefox refuses to start a MediaRecorder on a stream that has both audio and
120
+ // video tracks unless the MIME string declares the audio codec too. Chromium
121
+ // and Safari accept the video-only form and silently pick Opus/AAC. We keep
122
+ // both variants and always prefer the codec-complete ones in
123
+ // getSupportedMimeType so a single code path works across browsers.
124
+ export const MIME_TYPE = {
125
+ mp4: "video/mp4",
126
+ webmH264Opus: "video/webm;codecs=h264,opus",
127
+ webmH264: "video/webm;codecs=h264",
128
+ webmVp9Opus: "video/webm;codecs=vp9,opus",
129
+ webmVp9: "video/webm;codecs=vp9",
130
+ webmVp8Opus: "video/webm;codecs=vp8,opus",
131
+ webmVp8: "video/webm;codecs=vp8",
132
+ webm: "video/webm",
133
+ };
134
+
135
+ export const START_RECORDING_SOUND =
136
+ "https://neeto-record-static-assets.s3.amazonaws.com/recording-start-sound-2.mp3";
137
+
138
+ export const COUNTDOWN_TICK_SOUND =
139
+ "https://neeto-record-static-assets.s3.us-east-1.amazonaws.com/recording-tick-sound.mp3";
140
+
141
+ export const STOP_RECORDING_DUE_TO_LIMIT_REACHED_SOUND =
142
+ "https://neeto-record-static-assets.s3.amazonaws.com/recording-end-sound.mp3";
143
+
144
+ export const RECORDING_LIMIT_REACHED_WARNING_SOUND =
145
+ "https://neeto-record-static-assets.s3.amazonaws.com/recording-warning-sound.mp3";
146
+
147
+ export const RECORDING_TIME_LIMIT_FREE_PLAN = 15 * ONE_MINUTE_IN_MILLISECONDS; // 15 minutes
148
+ export const RECORDING_TIME_LIMIT_PRO_PLAN = 2 * ONE_HOUR_IN_MILLISECONDS; // 2 hours
149
+
150
+ export const MIC_NOT_WORKING_ALERT_TIME = 30;
151
+ export const MIC_NOT_WORKING_SILENCE_TIMEOUT =
152
+ MIC_NOT_WORKING_ALERT_TIME * 1000;
package/src/index.js ADDED
@@ -0,0 +1,5 @@
1
+ import "src/stylesheets/application";
2
+
3
+ import MediaRecorder from "./components/MediaRecorder";
4
+
5
+ export { MediaRecorder };