@vidtreo/recorder-vue 1.6.11 → 1.8.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.
Files changed (33) hide show
  1. package/README.md +250 -20
  2. package/dist/components/MobileRecordingPrompt.vue.d.ts +8 -0
  3. package/dist/components/MobileRecordingPromptToggle.vue.d.ts +12 -0
  4. package/dist/components/MobileWebRecorderUIContent.vue.d.ts +7 -0
  5. package/dist/components/NativeCameraUIContent.vue.d.ts +7 -0
  6. package/dist/components/StandardRecorder.vue.d.ts +5 -10
  7. package/dist/components/StandardRecorderContent.vue.d.ts +24 -0
  8. package/dist/components/VidtreoRecorder.vue.d.ts +5 -10
  9. package/dist/components/ui/PermissionFlowSteps.vue.d.ts +0 -1
  10. package/dist/components/ui/PreviewContent.vue.d.ts +4 -2
  11. package/dist/components/ui/RecordingControlsButtons.vue.d.ts +3 -2
  12. package/dist/components/ui/TranscodingProgress.vue.d.ts +1 -0
  13. package/dist/components/ui/UploadErrorOverlay.vue.d.ts +13 -0
  14. package/dist/components/ui/UploadProgress.vue.d.ts +1 -0
  15. package/dist/components/ui/UploadProgressOverlay.vue.d.ts +7 -0
  16. package/dist/composables/use-credential-error.d.ts +9 -0
  17. package/dist/composables/use-native-camera.d.ts +4 -1
  18. package/dist/composables/use-recorder-translations.d.ts +2 -0
  19. package/dist/composables/use-vidtreo-recorder.d.ts +6 -0
  20. package/dist/i18n/translations.d.ts +31 -1
  21. package/dist/index.d.ts +2 -1
  22. package/dist/index.js +1 -1
  23. package/dist/recorder-vue.css +1 -1
  24. package/dist/types/index.d.ts +29 -15
  25. package/dist/utils/config-builder.d.ts +1 -0
  26. package/dist/utils/device-error-overlay-mapper.d.ts +27 -0
  27. package/dist/utils/env-utils.d.ts +2 -1
  28. package/dist/utils/mobile-recording-prompt.d.ts +14 -0
  29. package/dist/utils/progress-overlay.d.ts +31 -0
  30. package/dist/utils/upload-error-message.d.ts +13 -0
  31. package/dist/utils/upload-label.d.ts +11 -0
  32. package/package.json +3 -2
  33. package/dist/services/upload-service-wrapper.d.ts +0 -12
package/README.md CHANGED
@@ -19,7 +19,7 @@ npm install @vidtreo/recorder-vue @vidtreo/recorder
19
19
  ```
20
20
 
21
21
  **Peer dependencies**:
22
- - `@vidtreo/recorder >=1.6.0`
22
+ - `@vidtreo/recorder >=1.8.0`
23
23
  - `vue >=3.0.0`
24
24
 
25
25
  Don't forget the stylesheet — either import it once in your entry, or rely on the built-in CSS injection (added to `<head>` automatically when the package loads).
@@ -66,19 +66,21 @@ const apiKey = import.meta.env.VITE_VIDTREO_API_KEY as string;
66
66
 
67
67
  ## Component API
68
68
 
69
- The component accepts a single `recorder-props` object so the discriminated union (`demo: true` vs `apiKey`) stays type-safe at the call site. Events use the standard Vue `@event-name` listener syntax.
69
+ The component accepts a single `recorder-props` object so the discriminated union (`demo: true` vs `apiKey` vs `getAccessToken`) stays type-safe at the call site. Events use the standard Vue `@event-name` listener syntax.
70
70
 
71
71
  ### Props (`recorder-props`)
72
72
 
73
73
  | Prop | Type | Required | Default | Description |
74
74
  |------|------|----------|---------|-------------|
75
- | `apiKey` | `string` | Yes* | – | API key for authentication. *Optional when `demo: true`. |
75
+ | `apiKey` | `string` | Yes* | – | API key for authentication. *Optional when `demo: true` or when `getAccessToken` is used. |
76
+ | `getAccessToken` | `() => Promise<string>` | No* | – | Returns a short-lived desktop access token minted by your server. Use instead of `apiKey` (exactly one of the two). Called again whenever a fresh token is needed, including when a queued upload resumes after a reload. |
76
77
  | `demo` | `boolean` | No | `false` | Demo mode. Skips upload and lets you download the local recording. |
77
78
  | `backendUrl` | `string` | No | `https://core.vidtreo.com` | Backend API URL. |
78
79
  | `countdownDuration` | `number` | No | – | Pre-recording countdown (milliseconds). |
79
- | `minTimeRecord` | `number` | No | – | Minimum recording time in ms before Stop is allowed (e.g., `10_000`). |
80
+ | `minTimeRecord` | `number` | No | – | Minimum recording time in ms before Stop is allowed. Must not be greater than `maxRecordingTime` when both are positive. |
80
81
  | `maxRecordingTime` | `number` | No | – | Maximum recording time in milliseconds. |
81
82
  | `userMetadata` | `Record<string, unknown>` | No | – | Custom metadata attached to uploads. |
83
+ | `recordingPrompt` | `RecordingPrompt` | No | – | Prompt shown during recording. Use `countdown: { show, placement: "above-countdown" }` to float it over the countdown. A `label` field is still accepted for backward compatibility but is not displayed. |
82
84
  | `enableSourceSwitching` | `boolean` | No | `true` | Toggle between camera and screen. |
83
85
  | `enableMute` | `boolean` | No | `true` | Show the mute/unmute button. |
84
86
  | `enablePause` | `boolean` | No | `true` | Show pause/resume buttons. |
@@ -97,18 +99,22 @@ The component accepts a single `recorder-props` object so the discriminated unio
97
99
  |-------|---------|------------|
98
100
  | `recording-start` | – | Recording begins (after the countdown finishes). |
99
101
  | `recording-stop` | – | Recording ends and processing starts. |
100
- | `upload-progress` | `progress: number` (0..1) | Each chunk is uploaded. |
101
- | `upload-complete` | `{ recordingId: string; uploadUrl: string }` | Upload finishes. |
102
- | `upload-error` | `error: Error` | Upload fails. |
103
- | `transcoding-progress` | `progress: number` (0..1) | Native-camera transcoding progress. |
104
- | `error` | `error: Error` | Any unhandled error. |
102
+ | `upload-progress` | `progress: number` (0..1), `phase: UploadProgressPhase \| null` | Upload progress in every flow (desktop, mobile and native camera, including resumed uploads). `phase` is `"preparing"`, `"transferring"`, `"finalizing"`, `"completed"`, or `null` when the upload starts (progress `0`). |
103
+ | `upload-complete` | `RecordingUploadResult` | Upload finishes. Same payload for the desktop/overlay recorder and native camera mode. See [Upload completion payload](#upload-completion-payload). |
104
+ | `upload-error` | `error: Error` | Upload fails. Use `getUploadErrorCode(error)` to read the [error code](#upload-errors). |
105
+ | `transcoding-progress` | `progress: number` (0..1) | Transcoding progress after a recording stops (desktop and mobile) and native camera processing. |
106
+ | `error` | `error: Error` | Any unhandled error, including the [credential conflict](#temporary-access-tokens) configuration error. |
105
107
 
106
108
  ### Example with listeners
107
109
 
108
110
  ```vue
109
111
  <script setup lang="ts">
110
112
  import { VidtreoRecorder } from "@vidtreo/recorder-vue";
111
- import type { VidtreoRecorderProps } from "@vidtreo/recorder-vue";
113
+ import type {
114
+ RecordingUploadResult,
115
+ UploadProgressPhase,
116
+ VidtreoRecorderProps,
117
+ } from "@vidtreo/recorder-vue";
112
118
 
113
119
  const recorderProps: VidtreoRecorderProps = {
114
120
  apiKey: "your-api-key",
@@ -117,13 +123,13 @@ const recorderProps: VidtreoRecorderProps = {
117
123
  lang: "en",
118
124
  };
119
125
 
120
- function onComplete(result: { recordingId: string; uploadUrl: string }) {
126
+ function onComplete(result: RecordingUploadResult) {
121
127
  console.log("Recording uploaded:", result.recordingId);
122
128
  console.log("View at:", result.uploadUrl);
123
129
  }
124
130
 
125
- function onProgress(progress: number) {
126
- console.log(`Upload: ${Math.round(progress * 100)}%`);
131
+ function onProgress(progress: number, phase: UploadProgressPhase | null) {
132
+ console.log(`Upload: ${Math.round(progress * 100)}% (${phase ?? "starting"})`);
127
133
  }
128
134
 
129
135
  function onError(error: Error) {
@@ -141,6 +147,113 @@ function onError(error: Error) {
141
147
  </template>
142
148
  ```
143
149
 
150
+ ### Temporary access tokens
151
+
152
+ ```vue
153
+ <script setup lang="ts">
154
+ import { VidtreoRecorder } from "@vidtreo/recorder-vue";
155
+
156
+ async function getAccessToken(): Promise<string> {
157
+ const response = await fetch("/api/vidtreo-token");
158
+ const { token } = await response.json();
159
+ return token;
160
+ }
161
+ </script>
162
+
163
+ <template>
164
+ <VidtreoRecorder :recorder-props="{ getAccessToken }" />
165
+ </template>
166
+ ```
167
+
168
+ The token is never stored. If an upload is interrupted, the component calls `getAccessToken` again when the upload resumes.
169
+
170
+ Pass either `apiKey` or `getAccessToken`, not both. The props type rejects both at compile time; at runtime (plain JavaScript) the component renders a configuration error with the message `Provide either apiKey or getAccessToken, not both` and emits `error` once with an error whose `code` is `CONFIG_ERROR_CREDENTIAL_CONFLICT` (`"config.credential-conflict"`). Passing neither (outside demo mode, and without `VIDTREO_API_KEY` in the environment) renders the `errorApiKeyRequired` configuration error and emits `error` once instead of throwing. The same applies when `StandardRecorder`, `MobileWebRecorderUI` or `NativeCameraUI` are used directly. Demo mode ignores credentials. `CONFIG_ERROR_CREDENTIAL_CONFLICT` and `isCredentialConflictError` are re-exported from `@vidtreo/recorder`:
171
+
172
+ ```ts
173
+ import { isCredentialConflictError } from "@vidtreo/recorder-vue";
174
+
175
+ function onError(error: Error) {
176
+ if (isCredentialConflictError(error)) {
177
+ reportMisconfiguration();
178
+ }
179
+ }
180
+ ```
181
+
182
+ ### Progress overlays
183
+
184
+ After you stop a recording the preview shows a progress overlay until the upload finishes:
185
+
186
+ | Stage | Label key | Progress |
187
+ |-------|-----------|----------|
188
+ | Finalizing the recording (before transcoding reports progress) | `finishing` | 0% |
189
+ | Transcoding | `finishing` | transcoding progress |
190
+ | Uploading | `uploading`, `finalizing` when the backend is finalizing, `retryingUpload` while a retry is pending | upload progress |
191
+
192
+ The same overlays show in the mobile overlay recorder. In native camera mode a resumed upload without a preview shows a standalone progress bar with the same labels.
193
+
194
+ ### Upload completion payload
195
+
196
+ `upload-complete` receives a `RecordingUploadResult`: every field of the backend upload result plus the backward-compatible `recordingId` and `uploadUrl`.
197
+
198
+ ```ts
199
+ import type { RecordingUploadResult } from "@vidtreo/recorder-vue";
200
+
201
+ type RecordingUploadResult = {
202
+ recordingId: string; // same value as id
203
+ uploadUrl: string; // "" when the backend has no URL yet
204
+ id: string;
205
+ publicId: string;
206
+ filename: string;
207
+ fileSize: number;
208
+ mimeType: string;
209
+ duration: number | null;
210
+ status: string;
211
+ createdAt: string;
212
+ transferStatus: "pending" | "transferring" | "transferred" | "failed" | null;
213
+ transferError: string | null;
214
+ transferredAt: string | null;
215
+ r2DeleteAfter: string | null;
216
+ r2DeletedAt: string | null;
217
+ };
218
+ ```
219
+
220
+ ### Upload errors
221
+
222
+ When an upload fails with a known cause, the component shows a dialog (`role="alertdialog"`) after recording and processing finish, and `upload-error` receives an error with a code:
223
+
224
+ ```vue
225
+ <script setup lang="ts">
226
+ import {
227
+ getUploadErrorCode,
228
+ UPLOAD_ERROR_INSUFFICIENT_CREDITS,
229
+ VidtreoRecorder,
230
+ } from "@vidtreo/recorder-vue";
231
+
232
+ function onUploadError(error: Error) {
233
+ if (getUploadErrorCode(error) === UPLOAD_ERROR_INSUFFICIENT_CREDITS) {
234
+ notifyAdmin();
235
+ }
236
+ }
237
+ </script>
238
+
239
+ <template>
240
+ <VidtreoRecorder
241
+ :recorder-props="{ apiKey: 'your-api-key' }"
242
+ @upload-error="onUploadError"
243
+ />
244
+ </template>
245
+ ```
246
+
247
+ | Code | Meaning |
248
+ |------|---------|
249
+ | `upload.insufficient-credits` | The account has no credits left (HTTP 402). The upload is not retried. |
250
+
251
+ `getUploadErrorCode` returns `null` for other errors. Network errors are retried automatically before they are reported; while a retry is in progress the progress bar shows the `retryingUpload` label.
252
+
253
+ ### Upload resume
254
+
255
+ Uploads are queued in IndexedDB before they are sent, in every mode (desktop, mobile overlay, mobile embed, and native camera). If the page is reloaded or the connection drops, the next mounted `VidtreoRecorder` resumes the upload with the same idempotency key and sends only the parts that are missing. Progress shows again while it resumes (in native camera mode as a standalone progress bar, since there is no preview), and `upload-complete` fires with the full payload when it finishes. Mount the component with the same credentials (`apiKey` or `getAccessToken`) so the upload can resume. If IndexedDB is unavailable, uploads go directly to the backend without persistence.
256
+
144
257
  ## Composable API
145
258
 
146
259
  When the default component doesn't fit your UI, drop down to the `useVidtreoRecorder` composable and assemble your own.
@@ -192,6 +305,7 @@ const { state, actions, audioLevel, controller } = useVidtreoRecorder({
192
305
  stream: MediaStream | null;
193
306
  isMuted: boolean;
194
307
  isPaused: boolean;
308
+ isFinalizingRecording: boolean; // true from stop until the recording blob is ready
195
309
  isAudioReady: boolean;
196
310
  hasAudioFailed: boolean;
197
311
  error: string | null;
@@ -199,6 +313,10 @@ const { state, actions, audioLevel, controller } = useVidtreoRecorder({
199
313
  countdown: number | null;
200
314
  timer: string; // "00:12" format
201
315
  uploadProgress: number | null; // 0..1 or null
316
+ uploadPhase: UploadProgressPhase | null; // "preparing" | "transferring" | "finalizing" | "completed"
317
+ uploadRetryAttempt: number | null;
318
+ uploadErrorCode: UploadErrorCode | null; // "upload.insufficient-credits"
319
+ transcodingProgress: number | null; // 0..1 while transcoding, otherwise null
202
320
  transitionMessage: string | null;
203
321
  isInitialized: boolean;
204
322
  recordedBlob: Blob | null; // populated in demo mode
@@ -228,6 +346,7 @@ const { state, actions, audioLevel, controller } = useVidtreoRecorder({
228
346
  | `startPreview` | `(sourceType?: "camera" \| "screen") => Promise<void>` | Open the stream without recording. |
229
347
  | `stopPreview` | `() => void` | Tear the preview stream down. |
230
348
  | `downloadVideo` | `() => void` | Download the last `recordedBlob` (demo mode). |
349
+ | `clearUploadError` | `() => void` | Clear `uploadErrorCode` after the user dismisses the upload error. |
231
350
  | `cleanup` | `() => void` | Release all resources. Useful before unmounting. |
232
351
 
233
352
  ### Specialized composables
@@ -235,7 +354,7 @@ const { state, actions, audioLevel, controller } = useVidtreoRecorder({
235
354
  | Composable | Purpose |
236
355
  |------------|---------|
237
356
  | `useMobileWebRecorder(config)` | Wraps `useVidtreoRecorder` and adds `isModalOpen`, `openModal`, `closeModal`, `canCloseModal` for the mobile overlay experience. |
238
- | `useNativeCamera(config)` | File-input + transcoding flow used when `mobileMode: "native"`. Returns `{ state, actions }` with `handleFileSelect`, `processAndUpload`, `downloadVideo`, `reset`. |
357
+ | `useNativeCamera(config)` | File-input + transcoding flow used when `mobileMode: "native"`. Returns `{ state, actions }` with `handleFileSelect`, `processAndUpload`, `downloadVideo`, `reset`. Resumes queued native uploads on mount (except in demo mode); `state` includes `uploadPhase`, `uploadRetryAttempt` and `uploadErrorCode`. |
239
358
  | `usePermissionFlow(options)` | Drives the camera/mic permission overlay. Returns `{ isActive, isComplete, currentStep, steps, recoveryData, requestPermission, retryPermission }` — useful if you want to build a fully custom permission UI. |
240
359
  | `useRecorderTranslations(translations)` | Splits a `TranslationKeys` object into `preview`, `buttons`, and `settings` subsets as `ComputedRef`s. Accepts `MaybeRefOrGetter<TranslationKeys>` so it stays reactive when the language changes. |
241
360
 
@@ -332,10 +451,76 @@ const language = ref<"en" | "es">("en");
332
451
 
333
452
  ### Translation keys
334
453
 
335
- | Key | English | Spanish |
336
- |-----|---------|---------|
454
+ Every key is identical (name and default copy) across `@vidtreo/recorder-react`, `@vidtreo/recorder-vue` and `@vidtreo/recorder-wc`.
455
+
456
+ | Key | English Default | Spanish Default |
457
+ |-----|----------------|-----------------|
337
458
  | `initializingCamera` | Initializing camera... | Inicializando cámara... |
338
459
  | `grantPermissions` | Grant camera and microphone permissions when prompted | Otorga permisos de cámara y micrófono cuando se solicite |
460
+ | `browserUnsupported` | This browser is not supported | Este navegador no es compatible |
461
+ | `browserUnsupportedDynamic` | `{browser} ({version}) is not supported, please use <a href="https://www.google.com/chrome/" target="_blank" rel="noopener noreferrer">Chrome</a>` | `{browser} ({version}) no es compatible, por favor usa <a href="https://www.google.com/chrome/" target="_blank" rel="noopener noreferrer">Chrome</a>` |
462
+ | `browserUnsupportedSafari` | `Safari (latest stable) is supported. If you experience issues, please use <a href="https://www.google.com/chrome/" target="_blank" rel="noopener noreferrer">Chrome</a>` | `Safari (última versión estable) es compatible. Si experimentas problemas, por favor usa <a href="https://www.google.com/chrome/" target="_blank" rel="noopener noreferrer">Chrome</a>` |
463
+ | `browserUnsupportedFirefox` | `Firefox is not supported, please use <a href="https://www.google.com/chrome/" target="_blank" rel="noopener noreferrer">Chrome</a>` | `Firefox no es compatible, por favor use <a href="https://www.google.com/chrome/" target="_blank" rel="noopener noreferrer">Chrome</a>` |
464
+ | `retryCamera` | Retry Camera | Reintentar Cámara |
465
+ | `cameraInUse` | Your camera is being used by another application. Close other apps using the camera (Zoom, Teams, Discord) and try again. | Tu cámara está siendo usada por otra aplicación. Cierra otras apps que usen la cámara (Zoom, Teams, Discord) e intenta de nuevo. |
466
+ | `cameraNotFound` | No camera detected. Connect a camera or check your device settings. | No se detectó ninguna cámara. Conecta una cámara o revisa la configuración de tu dispositivo. |
467
+ | `cameraPermissionDenied` | Camera access was denied. Allow camera access in your browser settings and try again. | Se denegó el acceso a la cámara. Permite el acceso a la cámara en la configuración de tu navegador e intenta de nuevo. |
468
+ | `cameraTimeout` | The camera took too long to start. Close other apps using the camera and try again. | La cámara tardó demasiado en iniciar. Cierra otras apps que usen la cámara e intenta de nuevo. |
469
+ | `failedToStartCamera` | Failed to start camera | Error al iniciar la cámara |
470
+ | `audioInUse` | Your microphone is being used by another application. Close other apps using the microphone (Zoom, Teams, Discord) and try again. | Tu micrófono está siendo usado por otra aplicación. Cierra otras apps que usen el micrófono (Zoom, Teams, Discord) e intenta de nuevo. |
471
+ | `audioNotFound` | No microphone detected. Connect a microphone or check your device settings. | No se detectó ningún micrófono. Conecta un micrófono o revisa la configuración de tu dispositivo. |
472
+ | `audioPermissionDenied` | Microphone access was denied. Allow microphone access in your browser settings and try again. | Se denegó el acceso al micrófono. Permite el acceso al micrófono en la configuración de tu navegador e intenta de nuevo. |
473
+ | `audioTimeout` | The microphone took too long to start. Close other apps using the microphone and try again. | El micrófono tardó demasiado en iniciar. Cierra otras apps que usen el micrófono e intenta de nuevo. |
474
+ | `failedToStartAudio` | Failed to start microphone | Error al iniciar el micrófono |
475
+ | `audioErrorTitle` | Microphone unavailable | Micrófono no disponible |
476
+ | `audioErrorMessage` | We couldn't access your microphone. It may be in use by another app like Zoom, Teams, or Discord. Please close it and try again. | No pudimos acceder a tu micrófono. Puede estar en uso por otra app como Zoom, Teams o Discord. Ciérrala e inténtalo de nuevo. |
477
+ | `audioErrorRetry` | Try again | Intentar de nuevo |
478
+ | `audioMissingTitle` | Recording has no audio | La grabación no tiene audio |
479
+ | `audioMissingMessage` | We couldn't capture audio in this recording. Your microphone may have been disconnected or blocked by the browser. Check your microphone and record again. | No pudimos capturar audio en esta grabación. Es posible que el micrófono se haya desconectado o que el navegador lo haya bloqueado. Verifica tu micrófono y vuelve a grabar. |
480
+ | `audioSilentTitle` | Recording is silent | La grabación quedó en silencio |
481
+ | `audioSilentMessage` | We didn't detect any sound during the recording. Make sure your microphone is working and not muted by your operating system, then record again. | No detectamos sonido durante la grabación. Verifica que tu micrófono esté funcionando y no esté silenciado por el sistema, luego vuelve a grabar. |
482
+ | `audioProcessingErrorTitle` | Audio processing error | Error al procesar el audio |
483
+ | `audioProcessingErrorMessage` | We couldn't process the audio in this recording. Please record again. | No pudimos procesar el audio de esta grabación. Por favor vuelve a grabar. |
484
+ | `audioMissingRetry` | Record again | Grabar de nuevo |
485
+ | `audioWarningNoSignalTitle` | No microphone signal | Sin señal del micrófono |
486
+ | `audioWarningNoSignalMessage` | We're not detecting any sound. Check that your microphone is active. | No estamos detectando sonido. Verifica que tu micrófono esté activo. |
487
+ | `audioWarningLowSignalTitle` | Audio is very quiet | Audio muy bajo |
488
+ | `audioWarningLowSignalMessage` | Move closer to the microphone or turn up the input volume. | Acércate al micrófono o sube el volumen de entrada. |
489
+ | `audioWarningSpeakingMutedTitle` | You're speaking while muted | Estás hablando muteado |
490
+ | `audioWarningSpeakingMutedMessage` | Unmute your microphone if you want your voice in the recording. | Activa el micrófono si quieres que tu voz se escuche en la grabación. |
491
+ | `audioWarningTrackEndedTitle` | Microphone disconnected | Micrófono desconectado |
492
+ | `audioWarningTrackEndedMessage` | The microphone was disconnected. Reconnect it before continuing. | Se desconectó el micrófono. Reconéctalo antes de continuar. |
493
+ | `audioWarningNoChunksTitle` | No microphone input | Sin entrada del micrófono |
494
+ | `audioWarningNoChunksMessage` | We're not receiving audio from the microphone. Check browser permissions. | No estamos recibiendo audio del micrófono. Revisa los permisos del navegador. |
495
+ | `audioWarningTrackMutedTitle` | Microphone muted by browser | Micrófono silenciado por el navegador |
496
+ | `audioWarningTrackMutedMessage` | The browser muted your microphone. Check site settings. | El navegador silenció tu micrófono. Revisa la configuración del sitio. |
497
+ | `audioWarningDismiss` | Dismiss | Cerrar |
498
+ | `cameraErrorTitle` | Camera unavailable | Cámara no disponible |
499
+ | `cameraErrorMessage` | We couldn't access your camera. It may be in use by another app. Please close it and try again. | No pudimos acceder a tu cámara. Puede estar en uso por otra app. Ciérrala e inténtalo de nuevo. |
500
+ | `browserErrorTitle` | Browser not supported | Navegador no compatible |
501
+ | `browserErrorMessage` | Your browser doesn't support video recording. Please use the latest version of Chrome for the best experience. | Tu navegador no es compatible con la grabación de video. Por favor usa la última versión de Chrome. |
502
+ | `recordingCodecUnsupportedTitle` | Recording format not supported | Formato de grabación no compatible |
503
+ | `recordingCodecUnsupportedMessage` | This device can't use the selected video format. Close other apps, update Chrome if possible, and record again. | Este dispositivo no puede usar el formato de video seleccionado. Cierra otras apps, actualiza Chrome si es posible y vuelve a grabar. |
504
+ | `recordingMediaEmptyTitle` | No video was produced | No se generó ningún video |
505
+ | `recordingMediaEmptyMessage` | The browser didn't produce a usable video. Check your camera and record again. | El navegador no produjo un video utilizable. Verifica la cámara y vuelve a grabar. |
506
+ | `recordingMediaErrorTitle` | Recording could not be finished | No se pudo finalizar la grabación |
507
+ | `recordingMediaErrorMessage` | The browser reported an error before the video was ready to upload. Record again. | El navegador informó un error antes de preparar el video para subirlo. Vuelve a grabar. |
508
+ | `recordingServerTranscodeFallbackTitle` | Video processing failed | No se pudo procesar el video |
509
+ | `recordingServerTranscodeFallbackMessage` | We couldn't prepare this video for upload on your device. Record again. | No pudimos preparar este video para subirlo en tu dispositivo. Vuelve a grabar. |
510
+ | `recordingTrackEndedTitle` | Camera stopped during recording | La cámara se detuvo durante la grabación |
511
+ | `recordingTrackEndedMessage` | The camera feed ended before the recording finished. Check that the camera is still connected and record again. | La señal de la cámara terminó antes de finalizar la grabación. Verifica que la cámara siga conectada y vuelve a grabar. |
512
+ | `recordingFinalizeTimeoutTitle` | Recording took too long to finish | La grabación tardó demasiado en finalizar |
513
+ | `recordingFinalizeTimeoutMessage` | This device may be low on memory or processing power. Close other apps or browser tabs, then record again. | Es posible que este dispositivo tenga poca memoria o potencia de procesamiento. Cierra otras apps o pestañas del navegador y vuelve a grabar. |
514
+ | `recordingStateRaceTitle` | Recording did not start correctly | La grabación no inició correctamente |
515
+ | `recordingStateRaceMessage` | The recording could not be finalized because it did not start cleanly. Please refresh the page and record again. | No se pudo finalizar la grabación porque no inició correctamente. Actualiza la página y vuelve a grabar. |
516
+ | `recordingNoFramesTitle` | No video was captured | No se capturó video |
517
+ | `recordingNoFramesMessage` | We couldn't receive video frames from the camera. Check your camera connection and record again. | No pudimos recibir fotogramas de video de la cámara. Verifica la conexión de la cámara y vuelve a grabar. |
518
+ | `recordingUnsupportedTitle` | Recording not available | Grabación no disponible |
519
+ | `recordingUnsupportedMessage` | This device or browser can't record video reliably right now. Check your connection, update Chrome if possible, or use another device. | Este dispositivo o navegador no puede grabar video de forma estable ahora. Revisa tu conexión, actualiza Chrome si es posible o usa otro dispositivo. |
520
+ | `recordingPipelineRetry` | Record again | Grabar de nuevo |
521
+ | `genericErrorTitle` | Something went wrong | Algo salió mal |
522
+ | `genericErrorMessage` | An unexpected error occurred. Please try again. | Ocurrió un error inesperado. Por favor inténtalo de nuevo. |
523
+ | `errorRetry` | Try again | Intentar de nuevo |
339
524
  | `switchingDevice` | Switching device... | Cambiando dispositivo... |
340
525
  | `recordingStartsIn` | Recording starts in... | La grabación comienza en... |
341
526
  | `switchingSource` | Switching source... | Cambiando fuente... |
@@ -343,7 +528,6 @@ const language = ref<"en" | "es">("en");
343
528
  | `settings` | Settings | Configuración |
344
529
  | `record` | Record | Grabar |
345
530
  | `stop` | Stop | Detener |
346
- | `minimumRecordingTimeNotReached` | You have not met the minimum recording time yet | Aun no cumples el tiempo minimo de grabacion |
347
531
  | `pause` | Pause | Pausar |
348
532
  | `resume` | Resume | Reanudar |
349
533
  | `mute` | Mute | Silenciar |
@@ -351,9 +535,51 @@ const language = ref<"en" | "es">("en");
351
535
  | `switchSource` | Switch Source | Cambiar Fuente |
352
536
  | `camera` | Camera | Cámara |
353
537
  | `microphone` | Microphone | Micrófono |
538
+ | `microphoneConnecting` | Connecting microphone... | Conectando micrófono... |
539
+ | `minimumRecordingTimeNotReached` | You have not met the minimum recording time yet | Aun no cumples el tiempo minimo de grabacion |
354
540
  | `uploading` | Uploading... | Subiendo... |
355
-
356
- The full key list lives in [`src/i18n/translations.ts`](./src/i18n/translations.ts) — there's a key for every visible string, including the permission flow recovery guide.
541
+ | `finalizing` | Finalizing… | Finalizando… |
542
+ | `retryingUpload` | Retrying upload... | Reintentando subida... |
543
+ | `uploadInsufficientCredits` | This video couldn't be uploaded. Please contact the site administrator. | No se pudo subir el video. Contacta al administrador del sitio. |
544
+ | `uploadInsufficientCreditsTitle` | Video couldn't be uploaded | No se pudo subir el video |
545
+ | `uploadErrorClose` | Close | Cerrar |
546
+ | `finishing` | Finishing... | Finalizando... |
547
+ | `userInAnotherTab` | User in another tab | Usuario en otra pestaña |
548
+ | `download` | Download | Descargar |
549
+ | `nativeCameraSelectVideo` | Select Video from Gallery | Seleccionar Video de la Galería |
550
+ | `nativeCameraRecordVideo` | Record with Camera | Grabar con Cámara |
551
+ | `nativeCameraProcessing` | Processing video... | Procesando video... |
552
+ | `nativeCameraConfigLoading` | Loading settings... | Cargando configuración... |
553
+ | `nativeCameraConfigLoadError` | Failed to load settings | No se pudo cargar la configuración |
554
+ | `nativeCameraPreviewAlt` | Video preview | Vista previa del video |
555
+ | `errorTitle` | Configuration Error | Error de Configuración |
556
+ | `errorApiKeyRequired` | An API Key or access token provider is required. | Se requiere una API Key o un proveedor de token de acceso. |
557
+ | `errorGeneric` | An error occurred while initializing the recorder | Ocurrió un error al inicializar la grabadora |
558
+ | `mobileOpenCamera` | Allow Access | Permitir Acceso |
559
+ | `mobileOpenCameraTitle` | Camera & Microphone | Cámara y Micrófono |
560
+ | `mobileOpenCameraDescription` | We need access to your camera and microphone to start recording | Necesitamos acceso a tu cámara y micrófono para comenzar a grabar |
561
+ | `mobileCloseCamera` | Close | Cerrar |
562
+ | `mobileHideRecordingPrompt` | Hide prompt | Ocultar pregunta |
563
+ | `mobileShowRecordingPrompt` | Show prompt | Mostrar pregunta |
564
+ | `mobilePermissionDenied` | Camera Access Denied | Acceso a Cámara Denegado |
565
+ | `mobilePermissionDeniedDescription` | Please allow camera access in your browser settings to record video. | Por favor permite el acceso a la cámara en la configuración de tu navegador para grabar video. |
566
+ | `permissionFlowTitle` | Set Up Your Camera | Configurar tu Cámara |
567
+ | `permissionFlowCameraTitle` | Camera & Microphone | Cámara y Micrófono |
568
+ | `permissionFlowMicrophoneTitle` | Camera & Microphone | Cámara y Micrófono |
569
+ | `permissionFlowCameraLabel` | We need access to your camera and microphone to start recording | Necesitamos acceso a tu cámara y micrófono para comenzar a grabar |
570
+ | `permissionFlowMicrophoneLabel` | We need access to your camera and microphone to start recording | Necesitamos acceso a tu cámara y micrófono para comenzar a grabar |
571
+ | `permissionFlowStatusPending` | Pending | Pendiente |
572
+ | `permissionFlowStatusGranted` | Ready | Listo |
573
+ | `permissionFlowStatusDenied` | Blocked | Bloqueado |
574
+ | `permissionFlowStatusRequesting` | Click "Allow" in the browser popup above | Haz clic en "Permitir" en el aviso del navegador |
575
+ | `permissionFlowAllowCamera` | Allow Access | Permitir Acceso |
576
+ | `permissionFlowAllowMicrophone` | Allow Access | Permitir Acceso |
577
+ | `permissionFlowRetry` | Try Again | Reintentar |
578
+ | `permissionFlowRecoveryTitle` | Allow access to continue | Permite el acceso para continuar |
579
+ | `permissionFlowRecoveryInstructions` | Open your browser settings and allow camera and microphone access, then try again. | Abre la configuración de tu navegador y permite el acceso a la cámara y micrófono, luego intenta de nuevo. |
580
+ | `permissionFlowConnecting` | Setting up... | Preparando... |
581
+
582
+ `TranslationKeys` lists every available key. The full key list lives in [`src/i18n/translations.ts`](./src/i18n/translations.ts) — there's a key for every visible string, including the permission flow recovery guide.
357
583
 
358
584
  ## Mobile experience
359
585
 
@@ -375,10 +601,14 @@ For other SSR setups, wrap the component in `<ClientOnly>` (Nuxt) or guard it be
375
601
 
376
602
  ## TypeScript
377
603
 
378
- Every public surface is typed. Import types directly:
604
+ Every public surface is typed. The package also re-exports `getUploadErrorCode` and `UPLOAD_ERROR_INSUFFICIENT_CREDITS` from `@vidtreo/recorder`. Import types directly:
379
605
 
380
606
  ```ts
381
607
  import type {
608
+ AccessTokenProvider,
609
+ RecordingUploadResult,
610
+ UploadErrorCode,
611
+ UploadProgressPhase,
382
612
  VidtreoRecorderProps,
383
613
  VidtreoRecorderState,
384
614
  VidtreoRecorderActions,
@@ -0,0 +1,8 @@
1
+ type __VLS_Props = {
2
+ className: string;
3
+ isVisible: boolean;
4
+ text: string;
5
+ };
6
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
@@ -0,0 +1,12 @@
1
+ type __VLS_Props = {
2
+ hideLabel: string;
3
+ isPromptVisible: boolean;
4
+ showLabel: string;
5
+ };
6
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ toggle: () => any;
8
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onToggle?: (() => any) | undefined;
10
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const _default: typeof __VLS_export;
12
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import type { UseVidtreoRecorderConfig } from "../types";
2
+ type __VLS_Props = {
3
+ config: UseVidtreoRecorderConfig;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import type { UseVidtreoRecorderConfig } from "../types";
2
+ type __VLS_Props = {
3
+ config: UseVidtreoRecorderConfig;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
@@ -1,28 +1,23 @@
1
+ import type { RecordingUploadResult, UploadProgressPhase } from "@vidtreo/recorder";
1
2
  import type { VidtreoRecorderProps } from "../types";
2
3
  type __VLS_Props = {
3
4
  recorderProps: VidtreoRecorderProps;
4
5
  };
5
6
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
7
  error: (error: Error) => any;
7
- uploadProgress: (progress: number) => any;
8
+ uploadProgress: (progress: number, phase: UploadProgressPhase | null) => any;
8
9
  transcodingProgress: (progress: number) => any;
9
10
  recordingStart: () => any;
10
11
  recordingStop: () => any;
11
- uploadComplete: (result: {
12
- recordingId: string;
13
- uploadUrl: string;
14
- }) => any;
12
+ uploadComplete: (result: RecordingUploadResult) => any;
15
13
  uploadError: (error: Error) => any;
16
14
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
15
  onError?: ((error: Error) => any) | undefined;
18
- onUploadProgress?: ((progress: number) => any) | undefined;
16
+ onUploadProgress?: ((progress: number, phase: UploadProgressPhase | null) => any) | undefined;
19
17
  onTranscodingProgress?: ((progress: number) => any) | undefined;
20
18
  onRecordingStart?: (() => any) | undefined;
21
19
  onRecordingStop?: (() => any) | undefined;
22
- onUploadComplete?: ((result: {
23
- recordingId: string;
24
- uploadUrl: string;
25
- }) => any) | undefined;
20
+ onUploadComplete?: ((result: RecordingUploadResult) => any) | undefined;
26
21
  onUploadError?: ((error: Error) => any) | undefined;
27
22
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
23
  declare const _default: typeof __VLS_export;
@@ -0,0 +1,24 @@
1
+ import { type RecordingUploadResult, type UploadProgressPhase } from "@vidtreo/recorder";
2
+ import type { VidtreoRecorderProps } from "../types";
3
+ type __VLS_Props = {
4
+ recorderProps: VidtreoRecorderProps;
5
+ };
6
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ error: (error: Error) => any;
8
+ uploadProgress: (progress: number, phase: UploadProgressPhase | null) => any;
9
+ transcodingProgress: (progress: number) => any;
10
+ recordingStart: () => any;
11
+ recordingStop: () => any;
12
+ uploadComplete: (result: RecordingUploadResult) => any;
13
+ uploadError: (error: Error) => any;
14
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
+ onError?: ((error: Error) => any) | undefined;
16
+ onUploadProgress?: ((progress: number, phase: UploadProgressPhase | null) => any) | undefined;
17
+ onTranscodingProgress?: ((progress: number) => any) | undefined;
18
+ onRecordingStart?: (() => any) | undefined;
19
+ onRecordingStop?: (() => any) | undefined;
20
+ onUploadComplete?: ((result: RecordingUploadResult) => any) | undefined;
21
+ onUploadError?: ((error: Error) => any) | undefined;
22
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
+ declare const _default: typeof __VLS_export;
24
+ export default _default;
@@ -1,28 +1,23 @@
1
+ import { type RecordingUploadResult, type UploadProgressPhase } from "@vidtreo/recorder";
1
2
  import type { VidtreoRecorderProps } from "../types";
2
3
  type __VLS_Props = {
3
4
  recorderProps: VidtreoRecorderProps;
4
5
  };
5
6
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
7
  error: (error: Error) => any;
7
- uploadProgress: (progress: number) => any;
8
+ uploadProgress: (progress: number, phase: UploadProgressPhase | null) => any;
8
9
  transcodingProgress: (progress: number) => any;
9
10
  recordingStart: () => any;
10
11
  recordingStop: () => any;
11
- uploadComplete: (result: {
12
- recordingId: string;
13
- uploadUrl: string;
14
- }) => any;
12
+ uploadComplete: (result: RecordingUploadResult) => any;
15
13
  uploadError: (error: Error) => any;
16
14
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
15
  onError?: ((error: Error) => any) | undefined;
18
- onUploadProgress?: ((progress: number) => any) | undefined;
16
+ onUploadProgress?: ((progress: number, phase: UploadProgressPhase | null) => any) | undefined;
19
17
  onTranscodingProgress?: ((progress: number) => any) | undefined;
20
18
  onRecordingStart?: (() => any) | undefined;
21
19
  onRecordingStop?: (() => any) | undefined;
22
- onUploadComplete?: ((result: {
23
- recordingId: string;
24
- uploadUrl: string;
25
- }) => any) | undefined;
20
+ onUploadComplete?: ((result: RecordingUploadResult) => any) | undefined;
26
21
  onUploadError?: ((error: Error) => any) | undefined;
27
22
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
23
  declare const _default: typeof __VLS_export;
@@ -15,7 +15,6 @@ export type PermissionFlowStepsTranslations = {
15
15
  retry: string;
16
16
  recoveryTitle: string;
17
17
  recoveryInstructions: string;
18
- recoveryGuideHint: string;
19
18
  cameraName: string;
20
19
  microphoneName: string;
21
20
  connecting: string;
@@ -1,4 +1,4 @@
1
- import type { RecorderController } from "@vidtreo/recorder";
1
+ import type { RecorderController, SourceType } from "@vidtreo/recorder";
2
2
  import type { ButtonVisibility } from "../../utils/button-visibility";
3
3
  import { type RecordingControlsButtonsTranslations } from "./RecordingControlsButtons.vue";
4
4
  export type PreviewContentState = {
@@ -25,10 +25,12 @@ export type PreviewContentTranslations = {
25
25
  cameraInUse: string;
26
26
  cameraNotFound: string;
27
27
  cameraPermissionDenied: string;
28
+ cameraTimeout: string;
28
29
  failedToStartCamera: string;
29
30
  audioInUse: string;
30
31
  audioNotFound: string;
31
32
  audioPermissionDenied: string;
33
+ audioTimeout: string;
32
34
  failedToStartAudio: string;
33
35
  switchingDevice: string;
34
36
  recordingStartsIn: string;
@@ -42,7 +44,7 @@ type __VLS_Props = {
42
44
  controller: RecorderController | null;
43
45
  audioLevel: number;
44
46
  buttonVisibility: ButtonVisibility;
45
- currentSourceType: "camera" | "screen";
47
+ currentSourceType: SourceType;
46
48
  isStopLocked: boolean;
47
49
  stopLockedTooltip: string;
48
50
  translations: PreviewContentTranslations;
@@ -1,3 +1,4 @@
1
+ import type { SourceType } from "@vidtreo/recorder";
1
2
  export type RecordingControlsButtonsTranslations = {
2
3
  settings: string;
3
4
  record: string;
@@ -29,7 +30,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
29
30
  isMuted: boolean;
30
31
  isAudioReady: boolean;
31
32
  isProcessingRecording: boolean;
32
- currentSourceType: "camera" | "screen";
33
+ currentSourceType: SourceType;
33
34
  isStopLocked: boolean;
34
35
  stopLockedTooltip: string;
35
36
  translations?: RecordingControlsButtonsTranslations;
@@ -56,7 +57,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
56
57
  isMuted: boolean;
57
58
  isAudioReady: boolean;
58
59
  isProcessingRecording: boolean;
59
- currentSourceType: "camera" | "screen";
60
+ currentSourceType: SourceType;
60
61
  isStopLocked: boolean;
61
62
  stopLockedTooltip: string;
62
63
  translations?: RecordingControlsButtonsTranslations;
@@ -1,4 +1,5 @@
1
1
  type __VLS_Props = {
2
+ label: string;
2
3
  progress: number;
3
4
  };
4
5
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,13 @@
1
+ import type { UploadErrorCode } from "@vidtreo/recorder";
2
+ import { type UploadErrorTranslations } from "../../utils/upload-error-message";
3
+ type __VLS_Props = {
4
+ errorCode: UploadErrorCode | null;
5
+ translations: UploadErrorTranslations;
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ close: () => any;
9
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
+ onClose?: (() => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -1,4 +1,5 @@
1
1
  type __VLS_Props = {
2
+ label: string;
2
3
  progress: number | null;
3
4
  visible: boolean;
4
5
  };
@@ -0,0 +1,7 @@
1
+ type __VLS_Props = {
2
+ progress: number | null;
3
+ label: string;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import type { AccessTokenProvider } from "@vidtreo/recorder";
2
+ import { type ComputedRef } from "vue";
3
+ type CredentialSource = {
4
+ apiKey?: string;
5
+ getAccessToken?: AccessTokenProvider;
6
+ demo?: boolean;
7
+ };
8
+ export declare function useCredentialError(source: () => CredentialSource, onError: (error: Error) => void): ComputedRef<Error | null>;
9
+ export {};