videomail-client 16.0.2 → 16.1.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/README.md +19 -19
- package/dist/cjs/index.cjs +340 -55
- package/dist/esm/client.d.ts +2 -0
- package/dist/esm/index.js +269 -53
- package/dist/esm/types/events/index.d.ts +3 -1
- package/dist/esm/types/events/params.d.ts +4 -0
- package/dist/esm/util/Despot.d.ts +2 -0
- package/dist/esm/util/html/media/AudioRecorder.d.ts +3 -0
- package/dist/esm/wrappers/container.d.ts +2 -0
- package/dist/esm/wrappers/form.d.ts +9 -2
- package/dist/esm/wrappers/visuals/recorder.d.ts +9 -0
- package/dist/esm/wrappers/visuals/userMedia.d.ts +8 -3
- package/dist/esm/wrappers/visuals.d.ts +3 -0
- package/dist/umd/index.js +280 -51
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -88,6 +88,8 @@ Audio recording is experimental and disabled by default. Set `audio.enabled` to
|
|
|
88
88
|
- [`videomailClient.show()`](#videomailclientshow)
|
|
89
89
|
- [`videomailClient.hide()`](#videomailclienthide)
|
|
90
90
|
- [`videomailClient.record()`](#videomailclientrecord)
|
|
91
|
+
- [`videomailClient.pause()`](#videomailclientpause)
|
|
92
|
+
- [`videomailClient.recoverCamera()`](#videomailclientrecovercamera)
|
|
91
93
|
- [`videomailClient.replay()`](#videomailclientreplayvideomail-parentelementid)
|
|
92
94
|
- [`videomailClient.startOver()`](#videomailclientstartover)
|
|
93
95
|
- [`videomailClient.getByAlias()`](#videomailclientgetbyaliasalias)
|
|
@@ -144,6 +146,22 @@ Automatically fills the DOM with a form for video recording. By default the HTML
|
|
|
144
146
|
|
|
145
147
|
Starts recording without requiring the user to press the record button.
|
|
146
148
|
|
|
149
|
+
### videomailClient.pause()
|
|
150
|
+
|
|
151
|
+
Pauses an active recording or countdown without discarding it. Idle cameras and unsent previews are left alone. Useful for native applications. To resume, refer to the next function `videomailClient.recoverCamera()`.
|
|
152
|
+
|
|
153
|
+
### videomailClient.recoverCamera()
|
|
154
|
+
|
|
155
|
+
Returns a `Promise<boolean>` indicating whether camera recovery succeeds. It restores playback for live tracks or requests a replacement stream when camera or microphone tracks have ended. Duplicate calls share the pending recovery. An unbuilt client, unsent preview, encoding, or submission is left alone and returns `false`.
|
|
156
|
+
|
|
157
|
+
Recovery preserves captured frame dimensions, frame/sample counters, and the audio sample rate. Foreground recovery never resumes capture or a countdown automatically. The user must explicitly choose Resume; that action waits for recovery before sending more frames.
|
|
158
|
+
|
|
159
|
+
With automatic pause enabled, browser visibility changes pause capture and recover the camera on return. Native hosts should call `pause()` on background and `recoverCamera()` on foreground through their own lifecycle integration. The client has no Capacitor dependency. Do not call `startOver()` to recover a paused take.
|
|
160
|
+
|
|
161
|
+
`CAMERA_RECOVERING` signals the start of recovery. `USER_MEDIA_READY` includes `recovering: true` after a replacement stream is initialized. `CAMERA_RECOVERY_FAILED` provides an `err` when access, playback, audio initialization, or the recovery deadline fails. The default notification does not reset the take; the user can retry Resume or stop to keep the recorded part. Stop, reset, unload, and submission cancel pending recovery, and late streams are stopped.
|
|
162
|
+
|
|
163
|
+
This does not reconnect a lost recording WebSocket or survive process termination. Physical-device camera and microphone validation remains necessary.
|
|
164
|
+
|
|
147
165
|
### videomailClient.replay(videomail[, parentElementId])
|
|
148
166
|
|
|
149
167
|
Adds a video player for the supplied videomail.
|
|
@@ -260,25 +278,7 @@ You can also retrieve this data with `videomailClient.getByKey()`.
|
|
|
260
278
|
|
|
261
279
|
## Form Submissions
|
|
262
280
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
For first-party Videomail forms without an explicit `action`, a recorded video is sent in one request to the Videomail API; listen for `SUBMITTED` to handle the response. Set `enableAutoSubmission: false` when a host framework owns form submission, then let that integration resume its submission after `SUBMITTED`.
|
|
266
|
-
|
|
267
|
-
If this does not work, verify that the configured selectors identify the form and its submit button:
|
|
268
|
-
|
|
269
|
-
```ts
|
|
270
|
-
selectors: {
|
|
271
|
-
formId: undefined,
|
|
272
|
-
submitButtonId: undefined,
|
|
273
|
-
submitButtonSelector: undefined,
|
|
274
|
-
}
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
When these values are `undefined` (the defaults), the client detects the nearest form and a button with `type="submit"` automatically.
|
|
278
|
-
|
|
279
|
-
### Include videomail meta data in Form Submissions
|
|
280
|
-
|
|
281
|
-
When the client sends the second, host-form request, enable `submitWithVideomail` to include full videomail metadata under the `videomail` key. Otherwise the original form fields include the videomail alias, which can later be resolved with `videomailClient.getByAlias(alias)`.
|
|
281
|
+
How to configure, inject meta data and test form submissions with the Videomail client can be found in [Form Submissions ✏️](./docs/FORM_SUBMISSIONS.md).
|
|
282
282
|
|
|
283
283
|
## Privacy and error reporting
|
|
284
284
|
|