@myinterview/widget-react 1.0.12 → 1.0.14-beta

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.
@@ -19,6 +19,8 @@ export declare const enum ACTIONS {
19
19
  SENTRY = "sentry"
20
20
  }
21
21
  export declare const enum EVENTS {
22
+ UNMUTE = "UNMUTE",
23
+ MUTE = "MUTE",
22
24
  ON_SET_MEDIA_STREAM = "ON_SET_MEDIA_STREAM",
23
25
  SEND_DATA = "SEND_DATA",
24
26
  MIC_CHECK = "MIC_CHECK",
@@ -1,29 +1,12 @@
1
1
  import { ActorRef, DoneInvokeEvent } from 'xstate';
2
2
  import { RefObject } from 'react';
3
- export interface RecorderInterface {
4
- isDefaultConstraint: boolean;
5
- audioDevices?: MediaDeviceInfo[];
6
- videoDevices?: MediaDeviceInfo[];
7
- selectedAudioDevice?: MediaDeviceInfo;
8
- selectedVideoDevice?: MediaDeviceInfo;
9
- mediaRecorder?: MediaRecorder | null;
10
- mediaStream?: MediaStream | null;
11
- videoRef: RefObject<HTMLVideoElement>;
12
- microphoneRef: ActorRef<DoneInvokeEvent<any>> | null;
13
- speedTestLevel: SPEED_TEST_LEVEL;
14
- videoBitsPerSecond: number;
15
- mimeType: string;
16
- mimeTypes: string[];
17
- error: {};
18
- countdown: number;
19
- recordingTime: number;
20
- facingMode: any;
21
- durations: number;
22
- constraint: ConstrainProps;
23
- autoStart: boolean;
24
- isMicError: boolean;
3
+ export declare const enum SPEED_TEST_LEVEL {
4
+ LOW = 0,
5
+ MEDIUM = 1,
6
+ HIGH = 2
25
7
  }
26
- interface ConstrainProps {
8
+ export declare type mediaDeviceType = 'video' | 'audio';
9
+ declare type ConstrainProps = {
27
10
  video: {
28
11
  width: {
29
12
  min?: number;
@@ -33,78 +16,183 @@ interface ConstrainProps {
33
16
  aspectRatio?: number;
34
17
  };
35
18
  audio: boolean;
19
+ };
20
+ interface FacingMode {
21
+ exact: string;
22
+ }
23
+ export interface RecorderInterface {
24
+ facingMode: FacingMode;
25
+ microphoneRef: ActorRef<DoneInvokeEvent<any>> | null;
26
+ mediaStream?: MediaStream;
27
+ mediaRecorder?: MediaRecorder;
28
+ videoDevices: MediaDeviceInfo[];
29
+ audioDevices: MediaDeviceInfo[];
30
+ selectedVideoDevice?: MediaDeviceInfo;
31
+ selectedAudioDevice?: MediaDeviceInfo;
32
+ mimeType: string;
33
+ mimeTypes: string[];
34
+ isMobile: boolean;
35
+ isSafeMode: boolean;
36
+ isAutoStart: boolean;
37
+ speedTestLevel: SPEED_TEST_LEVEL;
38
+ constraint: ConstrainProps;
39
+ videoRef: RefObject<HTMLVideoElement>;
40
+ videoBitsPerSecond: number;
41
+ countdown: number;
42
+ recordingTime: number;
43
+ durations: number;
44
+ isMicError: boolean;
45
+ }
46
+ export declare const enum MIME_TYPES {
47
+ WEBM = "video/webm",
48
+ MP4 = "video/mp4"
36
49
  }
37
- export declare type mediaDeviceType = 'video' | 'audio';
38
50
  export declare const enum STATES {
39
51
  INIT = "init",
40
52
  IDLE = "idle",
41
53
  RECORDING = "recording",
42
54
  WAITING = "waiting",
43
- ERROR = "error"
44
- }
45
- export declare const enum RECORDER_STATES {
55
+ ERROR = "error",
46
56
  INIT_RECORDER = "initRecorder",
47
57
  COUNT_DOWN = "countDown",
48
58
  COLLECTING_BLOBS = "collectingBlobs",
49
59
  RECORDER_TIMER = "recorderTimer",
50
60
  RECORDER_SENDING_BLOBS = "recorderSendingBlobs"
51
61
  }
52
- export declare const enum RECORDER_EVENTS {
53
- PAUSE = "PAUSE",
54
- START_RECORDING = "START_RECORDING",
55
- STOP_RECORDING = "STOP_RECORDING",
56
- RETRY = "RETRY",
62
+ export declare const enum ACTIONS {
63
+ SESSION_EVENT = "SESSION_EVENT",
64
+ SENTRY = "SENTRY",
65
+ CONSOLE_LOG = "CONSOLE_LOG",
66
+ REMOVE_MIC_ERROR = "REMOVE_MIC_ERROR",
67
+ PAUSE_MEDIA_RECORDER = "PAUSE_MEDIA_RECORDER",
68
+ RESUME_MEDIA_RECORDER = "RESUME_MEDIA_RECORDER",
69
+ SEND_CURRENT_TAKE = "SEND_CURRENT_TAKE",
70
+ STOP_MICROPHONE_MACHINE = "STOP_MICROPHONE_MACHINE",
71
+ STOP_MEDIA_RECORDER = "STOP_MEDIA_RECORDER",
72
+ DISABLED_AUTO_START = "DISABLED_AUTO_START",
73
+ SET_AUTO_START = "SET_AUTO_START",
74
+ UPDATE_RECORDING_TIME = "UPDATE_RECORDING_TIME",
75
+ UPDATE_COUNT_DOWN = "UPDATE_COUNT_DOWN",
76
+ SET_MIC_MACHINE = "INIT_MIC_MACHINE",
77
+ SEND_MEDIA_STREAM_TO_MIC_MACHINE = "SET_MEDIA_STREAM_TO_MIC_MACHINE",
78
+ SET_MEDIA_STREAM_CORE = "SET_MEDIA_STREAM_CORE",
79
+ STOP_MEDIA_STREAM = "STOP_MEDIA_STREAM",
80
+ SET_MIME_TYPE = "SET_MIME_TYPE",
81
+ SET_SAFE_MODE = "SET_SAFE_MODE",
82
+ SEND_ERROR_TO_PARENT = "SEND_ERROR_TO_PARENT",
83
+ SEND_SUCCESS_TO_PARENT = "SEND_SUCCESS_TO_PARENT",
84
+ CHANGE_VIDEO_DEVICE = "CHANGE_VIDEO_DEVICE",
85
+ CHANGE_AUDIO_DEVICE = "CHANGE_AUDIO_DEVICE",
57
86
  SET_QUESTION_PARAMS = "SET_QUESTION_PARAMS",
87
+ UPDATE_CONSTRAINT = "UPDATE_CONSTRAINT",
88
+ UPDATE_AUDIO_AND_VIDEO_DEVICES = "UPDATE_AUDIO_AND_VIDEO_DEVICES",
89
+ SET_FORCE_START = "SET_FORCE_START",
90
+ RESET_MACHINE = "RESET_MACHINE",
91
+ UPDATE_MACHINE_FOR_NEW_QUESTION = "UPDATE_MACHINE_FOR_NEW_QUESTION",
92
+ SET_MEDIA_RECORDER = "SET_MEDIA_RECORDER",
93
+ SET_MIC_ERROR = "SET_MIC_ERROR"
94
+ }
95
+ export declare const enum EVENTS {
58
96
  CHANGE_VIDEO_DEVICE = "CHANGE_VIDEO_DEVICE",
59
97
  CHANGE_AUDIO_DEVICE = "CHANGE_AUDIO_DEVICE",
60
- TICK = "TICK",
98
+ START_RECORDING = "START_RECORDING",
99
+ SET_QUESTION_PARAMS = "SET_QUESTION_PARAMS",
100
+ SPEED_TEST_RESULT_UPDATED = "SPEED_TEST_RESULT_UPDATED",
101
+ RECORDER_DEVICE_ERROR = "RECORDER_DEVICE_ERROR",
102
+ UPDATE_DEVICES_LIST = "UPDATE_DEVICES_LIST",
103
+ UPDATE_CURRENT_DEVICE = "UPDATE_CURRENT_DEVICE",
104
+ RECORDING_UPDATE_TIMER = "RECORDING_UPDATE_TIMER",
105
+ UPDATE_TIMER = "UPDATE_TIMER",
61
106
  FORCE_START = "FORCE_START",
62
- INIT_RECORDER = "INIT_RECORDER",
63
- SAVE = "SAVE",
107
+ STOP_RECORDING = "STOP_RECORDING",
108
+ SET_MEDIA_RECORDER = "SET_MEDIA_RECORDER",
109
+ SEND_CURRENT_TAKE = "SEND_CURRENT_TAKE",
64
110
  RE_INIT = "RE_INIT",
111
+ RETRY = "RETRY",
65
112
  MIC_DATA_RECEIVED = "MIC_DATA_RECEIVED",
66
- SPEED_TEST_RESULT_UPDATED = "SPEED_TEST_RESULT_UPDATED"
67
- }
68
- export declare const enum ACTIONS {
69
- CLEAN_MIC_ERROR = "CLEAN_MIC_ERROR",
70
- SET_MIC_ERROR = "setMicError",
71
- DISABLE_AUTO_START = "disableAutoStart",
72
- AUTO_START = "autoStart",
73
- PAUSE_MEDIA_RECORDER = "pauseMediaRecorder",
74
- ACTIVATE_MEDIA_RECORDER = "activateMediaRecorder",
75
- SESSION_EVENT = "sessionEvent",
76
- DISABLE_DEFAULT_CONSTRAINT = "disableDefaultConstraint",
77
- SET_DEFAULT_CONSTRAINT = "setDefaultConstraint",
78
- SET_MEDIA_STREAM = "setMediaStream",
79
- SET_ERROR = "setError",
80
- SET_INITIAL_CONTEXT = "setInitialContext",
81
- STOP_MEDIA_STREAM = "stopMediaStream",
82
- SET_MEDIA_STREAM_AUDIO_CHANGE = "setMediaStreamAudioChange",
83
- SET_MEDIA_STREAM_VIDEO_CHANGE = "setMediaStreamVideoChange",
84
- SET_MIC_MEDIA_STREAM = "SET_MIC_MEDIA_STREAM",
85
- SAVE_TAKE = "SAVE_TAKE",
86
- CLEAN = "CLEAN",
87
- SET_QUESTION_PARAMS = "SET_QUESTION_PARAMS",
88
- RESET = "REST",
89
- SEND_ERROR = "SEND_ERROR",
90
- SET_MEDIA_RECORDER = "setMediaRecorder",
91
- SET_MIME_TYPE = "setmimeType",
92
- SET_TIME_TO_START = "setTimeToStart",
93
- SET_RECORDING_TIME = "setRecordingTime",
94
- STOP_MEDIA_RECORDER = "stopMediaRecorder",
95
- FORCE_START = "forceStart",
96
- STOP_MIC = "stopMic",
97
- SET_SPEED_TEST = "setSpeedTest",
98
- SET_CONSTRAINT = "setConstraint",
99
- SENTRY = "sentry"
113
+ PAUSE_MEDIA_RECORDER = "PAUSE_MEDIA_RECORDER"
100
114
  }
101
- export declare const enum RECORDER_SERVICE {
115
+ export declare const enum SERVICES {
102
116
  GET_MEDIA_STREAM = "getMediaStream",
103
117
  GET_MEDIA_RECORDER = "getMediaRecorder"
104
118
  }
105
- export declare const enum SPEED_TEST_LEVEL {
106
- LOW = 0,
107
- MEDIUM = 1,
108
- HIGH = 2
119
+ export declare const enum GUARDS {
120
+ IS_TIME_TO_STOP_RECORDING = "isTimeToStopRecording",
121
+ IS_RECORDER_ACTIVE = "isRecorderActive",
122
+ IS_TIME_TO_START_RECORDING = "isTimeToStartRecording",
123
+ NO_SOUND_FROM_MIC_MACHINE = "noSoundFromMicMachine",
124
+ IS_NOT_ALLOWED_ERROR = "isNotAllowedError",
125
+ IS_ERROR_WITH_WRONG_PARAMS = "isErrorWithWrongParams",
126
+ IS_AUTO_START = "isAutoStart",
127
+ IS_QUALITY_CHANGED = "isQualityChanged"
109
128
  }
129
+ export declare const mediaConstrains: {
130
+ hd: {
131
+ video: {
132
+ width: {
133
+ min: number;
134
+ ideal: number;
135
+ max: number;
136
+ };
137
+ };
138
+ audio: boolean;
139
+ };
140
+ vga: {
141
+ video: {
142
+ width: {
143
+ max: number;
144
+ ideal: number;
145
+ };
146
+ };
147
+ audio: boolean;
148
+ };
149
+ qvga: {
150
+ video: {
151
+ width: {
152
+ min: number;
153
+ ideal: number;
154
+ max: number;
155
+ };
156
+ aspectRatio: number;
157
+ };
158
+ audio: boolean;
159
+ };
160
+ mobile: {
161
+ video: {
162
+ width: {
163
+ min: number;
164
+ ideal: number;
165
+ max: number;
166
+ };
167
+ aspectRatio: number;
168
+ };
169
+ audio: boolean;
170
+ };
171
+ mobile2: {
172
+ video: {
173
+ width: {
174
+ min: number;
175
+ ideal: number;
176
+ max: number;
177
+ };
178
+ aspectRatio: number;
179
+ };
180
+ audio: boolean;
181
+ };
182
+ mobile3: {
183
+ video: {
184
+ width: {
185
+ min: number;
186
+ ideal: number;
187
+ max: number;
188
+ };
189
+ aspectRatio: number;
190
+ };
191
+ audio: boolean;
192
+ };
193
+ noVideo: {
194
+ video: boolean;
195
+ audio: boolean;
196
+ };
197
+ };
110
198
  export {};
@@ -197,7 +197,9 @@ export declare const enum GUARDS {
197
197
  ARE_ALL_QUESTIONS_UPLOADED = "areAllQuestionsUploaded",
198
198
  SHOULD_SHOW_WELCOME = "shouldShowWelcome",
199
199
  IS_NO_SOUND_ERROR = "isNoSoundError",
200
- IS_VIDEO_CORRUPTED = "isVideoCorrupted"
200
+ IS_VIDEO_CORRUPTED = "isVideoCorrupted",
201
+ IS_AUDIO_ERROR = "isAudioError",
202
+ IS_VIDEO_ERROR = "isVideoError"
201
203
  }
202
204
  export declare const enum TAGS {
203
205
  SETUP = "setup",
@@ -0,0 +1,28 @@
1
+ export declare const TYPES_EXPLANATION: {
2
+ VIDEO: string;
3
+ AUDIO: string;
4
+ VIDEO_AUDIO: string;
5
+ };
6
+ export declare const enum MEDIA_RECORDER_STATES {
7
+ INACTIVE = "inactive",
8
+ RECORDING = "recording",
9
+ PAUSED = "paused"
10
+ }
11
+ export declare const ERROR_ENUM: {
12
+ NotAllowedError: string;
13
+ NotFoundError: string;
14
+ NotReadableError: string;
15
+ AbortError: string;
16
+ OverconstrainedError: string;
17
+ SecurityError: string;
18
+ TypeError: string;
19
+ NoSoundError: string;
20
+ UndefinedError: string;
21
+ };
22
+ export declare const recorderErrors: {
23
+ [x: string]: {
24
+ type: string;
25
+ message: string;
26
+ name: string;
27
+ };
28
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myinterview/widget-react",
3
- "version": "1.0.12",
3
+ "version": "1.0.14-beta",
4
4
  "description": "myInterview widget v3",
5
5
  "module": "dist/esm/index.js",
6
6
  "files": [
@@ -8,8 +8,8 @@
8
8
  ],
9
9
  "types": "dist/index.d.ts",
10
10
  "dependencies": {
11
- "@myinterview/component-library": "1.0.12",
12
11
  "@cloudflare/stream-react": "^1.8.0",
12
+ "@myinterview/component-library": "^1.0.14",
13
13
  "@sentry/react": "^7.7.0",
14
14
  "@sentry/tracing": "^7.7.0",
15
15
  "@xstate/react": "^3.0.1",
@@ -22,6 +22,7 @@
22
22
  "react-i18next": "^11.18.5",
23
23
  "react-player": "^2.10.1",
24
24
  "react-use-intercom": "^2.0.0",
25
+ "rxjs": "^7.5.7",
25
26
  "web-vitals": "^2.1.4",
26
27
  "xstate": "^4.33.2"
27
28
  },