@vidtreo/recorder-vue 1.6.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 (41) hide show
  1. package/README.md +412 -0
  2. package/dist/components/MobileWebRecorderUI.vue.d.ts +7 -0
  3. package/dist/components/NativeCameraUI.vue.d.ts +7 -0
  4. package/dist/components/StandardRecorder.vue.d.ts +29 -0
  5. package/dist/components/VidtreoRecorder.vue.d.ts +29 -0
  6. package/dist/components/ui/AudioVisualizer.vue.d.ts +7 -0
  7. package/dist/components/ui/AudioWarningToast.vue.d.ts +35 -0
  8. package/dist/components/ui/ConfigurationErrorDisplay.vue.d.ts +9 -0
  9. package/dist/components/ui/DeviceErrorOverlay.vue.d.ts +14 -0
  10. package/dist/components/ui/DeviceSelector.vue.d.ts +18 -0
  11. package/dist/components/ui/ErrorBoundary.vue.d.ts +21 -0
  12. package/dist/components/ui/PermissionFlowSteps.vue.d.ts +40 -0
  13. package/dist/components/ui/PermissionRecoveryGuide.vue.d.ts +7 -0
  14. package/dist/components/ui/PreviewContent.vue.d.ts +72 -0
  15. package/dist/components/ui/RecordingControlsButtons.vue.d.ts +72 -0
  16. package/dist/components/ui/SettingsPanel.vue.d.ts +34 -0
  17. package/dist/components/ui/TranscodingProgress.vue.d.ts +6 -0
  18. package/dist/components/ui/UploadProgress.vue.d.ts +7 -0
  19. package/dist/components/ui/VideoPreview.vue.d.ts +16 -0
  20. package/dist/components/ui/VideoPreviewSkeleton.vue.d.ts +8 -0
  21. package/dist/composables/use-mobile-web-recorder.d.ts +8 -0
  22. package/dist/composables/use-native-camera.d.ts +22 -0
  23. package/dist/composables/use-permission-flow.d.ts +22 -0
  24. package/dist/composables/use-recorder-translations.d.ts +46 -0
  25. package/dist/composables/use-vidtreo-recorder.d.ts +2 -0
  26. package/dist/constants/constants.d.ts +1 -0
  27. package/dist/i18n/translations.d.ts +96 -0
  28. package/dist/index.d.ts +16 -0
  29. package/dist/index.js +1 -0
  30. package/dist/recorder-vue.css +1 -0
  31. package/dist/services/config-service-wrapper.d.ts +15 -0
  32. package/dist/services/upload-service-wrapper.d.ts +12 -0
  33. package/dist/types/index.d.ts +128 -0
  34. package/dist/utils/button-visibility.d.ts +18 -0
  35. package/dist/utils/config-builder.d.ts +4 -0
  36. package/dist/utils/device-error-overlay-mapper.d.ts +29 -0
  37. package/dist/utils/download-file.d.ts +1 -0
  38. package/dist/utils/env-utils.d.ts +1 -0
  39. package/dist/utils/min-time-record.d.ts +9 -0
  40. package/dist/utils/recorder-constants.d.ts +12 -0
  41. package/package.json +68 -0
@@ -0,0 +1,128 @@
1
+ import type { AudioWarning, RecorderController, RecordingState, SourceType } from "@vidtreo/recorder";
2
+ import type { Ref, ShallowRef } from "vue";
3
+ import type { PartialTranslations } from "../i18n/translations";
4
+ export type MobileMode = "embed" | "overlay" | "native";
5
+ type BaseRecorderProps = {
6
+ backendUrl?: string;
7
+ countdownDuration?: number;
8
+ minTimeRecord?: number;
9
+ maxRecordingTime?: number;
10
+ maxFileSize?: number;
11
+ userMetadata?: Record<string, unknown>;
12
+ enableSourceSwitching?: boolean;
13
+ enableMute?: boolean;
14
+ enablePause?: boolean;
15
+ enableDeviceChange?: boolean;
16
+ enableTabVisibilityOverlay?: boolean;
17
+ tabVisibilityOverlayText?: string;
18
+ lang?: string;
19
+ texts?: PartialTranslations;
20
+ /** @deprecated Use mobileMode instead */
21
+ nativeCamera?: boolean;
22
+ mobileMode?: MobileMode;
23
+ };
24
+ type DemoModeProps = BaseRecorderProps & {
25
+ demo: true;
26
+ apiKey?: string;
27
+ };
28
+ type ProductionModeProps = BaseRecorderProps & {
29
+ demo?: false;
30
+ apiKey: string;
31
+ };
32
+ export type VidtreoRecorderProps = DemoModeProps | ProductionModeProps;
33
+ export type VidtreoRecorderEmits = {
34
+ recordingStart: [];
35
+ recordingStop: [];
36
+ uploadComplete: [result: {
37
+ recordingId: string;
38
+ uploadUrl: string;
39
+ }];
40
+ uploadProgress: [progress: number];
41
+ uploadError: [error: Error];
42
+ transcodingProgress: [progress: number];
43
+ error: [error: Error];
44
+ };
45
+ export type UseVidtreoRecorderConfig = {
46
+ apiKey: string;
47
+ backendUrl?: string;
48
+ countdownDuration?: number;
49
+ minTimeRecord?: number;
50
+ maxRecordingTime?: number;
51
+ maxFileSize?: number;
52
+ userMetadata?: Record<string, unknown>;
53
+ enableSourceSwitching?: boolean;
54
+ enableMute?: boolean;
55
+ enablePause?: boolean;
56
+ enableDeviceChange?: boolean;
57
+ enableTabVisibilityOverlay?: boolean;
58
+ tabVisibilityOverlayText?: string;
59
+ proxyEndpoint?: string;
60
+ demo?: boolean;
61
+ /** @deprecated Use mobileMode instead */
62
+ nativeCamera?: boolean;
63
+ mobileMode?: MobileMode;
64
+ lang?: string;
65
+ texts?: PartialTranslations;
66
+ onUploadComplete?: (result: {
67
+ recordingId: string;
68
+ uploadUrl: string;
69
+ }) => void;
70
+ onUploadProgress?: (progress: number) => void;
71
+ onUploadError?: (error: Error) => void;
72
+ onRecordingStart?: () => void;
73
+ onRecordingStop?: () => void;
74
+ onError?: (error: Error) => void;
75
+ onTranscodingProgress?: (progress: number) => void;
76
+ };
77
+ export type VidtreoRecorderState = {
78
+ recordingState: RecordingState;
79
+ stream: MediaStream | null;
80
+ isMuted: boolean;
81
+ isPaused: boolean;
82
+ isAudioReady: boolean;
83
+ hasAudioFailed: boolean;
84
+ error: string | null;
85
+ errorCode: string | null;
86
+ browserName: string | null;
87
+ browserVersion: string | null;
88
+ countdown: number | null;
89
+ timer: string;
90
+ uploadProgress: number | null;
91
+ transitionMessage: string | null;
92
+ isInitialized: boolean;
93
+ recordedBlob: Blob | null;
94
+ audioWarning: AudioWarning | null;
95
+ audioRecovered: boolean;
96
+ devices: {
97
+ cameras: MediaDeviceInfo[];
98
+ microphones: MediaDeviceInfo[];
99
+ selectedCamera: string | null;
100
+ selectedMic: string | null;
101
+ };
102
+ };
103
+ export type VidtreoRecorderActions = {
104
+ startRecording: (sourceType?: SourceType) => Promise<void>;
105
+ stopRecording: () => Promise<RecordingStopResult>;
106
+ pauseRecording: () => void;
107
+ resumeRecording: () => void;
108
+ toggleMute: () => void;
109
+ switchSource: (sourceType: SourceType) => Promise<void>;
110
+ changeCamera: (deviceId: string) => Promise<void>;
111
+ changeMic: (deviceId: string) => Promise<void>;
112
+ startPreview: (sourceType?: SourceType) => Promise<void>;
113
+ stopPreview: () => void;
114
+ downloadVideo: () => void;
115
+ cleanup: () => void;
116
+ };
117
+ export type RecordingStopResult = {
118
+ recordingId: string;
119
+ uploadUrl: string;
120
+ blob: Blob;
121
+ };
122
+ export type UseVidtreoRecorderReturn = {
123
+ state: VidtreoRecorderState;
124
+ actions: VidtreoRecorderActions;
125
+ audioLevel: Ref<number>;
126
+ controller: ShallowRef<RecorderController | null>;
127
+ };
128
+ export type { AudioWarning, RecordingState, SourceType, } from "@vidtreo/recorder";
@@ -0,0 +1,18 @@
1
+ export type ButtonVisibility = {
2
+ showSettingsButton: boolean;
3
+ showMuteButton: boolean;
4
+ showPauseButton: boolean;
5
+ showResumeButton: boolean;
6
+ showStopButton: boolean;
7
+ showSwitchSourceButton: boolean;
8
+ showDownloadButton?: boolean;
9
+ };
10
+ type ButtonVisibilityConfig = {
11
+ enableDeviceChange?: boolean;
12
+ enableMute?: boolean;
13
+ enablePause?: boolean;
14
+ enableSourceSwitching?: boolean;
15
+ isMobile?: boolean;
16
+ };
17
+ export declare function calculateButtonVisibility(isRecording: boolean, recordingState: string, isPaused: boolean, config: ButtonVisibilityConfig): ButtonVisibility;
18
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { RecorderConfig } from "@vidtreo/recorder";
2
+ import type { VidtreoRecorderProps } from "../types";
3
+ export declare function normalizeBackendUrl(url: string | null | undefined): string;
4
+ export declare function buildRecorderConfig(props: VidtreoRecorderProps, apiKey: string): RecorderConfig;
@@ -0,0 +1,29 @@
1
+ import type { DeviceErrorResult } from "@vidtreo/recorder";
2
+ export type DeviceErrorOverlayTranslations = {
3
+ audioErrorTitle: string;
4
+ audioErrorMessage: string;
5
+ audioErrorRetry: string;
6
+ audioMissingTitle: string;
7
+ audioMissingMessage: string;
8
+ audioSilentTitle: string;
9
+ audioSilentMessage: string;
10
+ audioProcessingErrorTitle: string;
11
+ audioProcessingErrorMessage: string;
12
+ audioMissingRetry: string;
13
+ cameraErrorTitle: string;
14
+ cameraErrorMessage: string;
15
+ browserErrorTitle: string;
16
+ browserErrorMessage: string;
17
+ genericErrorTitle: string;
18
+ genericErrorMessage: string;
19
+ errorRetry: string;
20
+ };
21
+ export type DeviceErrorOverlayData = {
22
+ visible: boolean;
23
+ variant: "camera" | "audio" | "browser" | "generic";
24
+ title: string;
25
+ message: string;
26
+ retryLabel?: string;
27
+ canRetry: boolean;
28
+ };
29
+ export declare function mapDeviceErrorToOverlay(result: DeviceErrorResult, translations: DeviceErrorOverlayTranslations, errorMessage?: string | null, errorCode?: string | null): DeviceErrorOverlayData;
@@ -0,0 +1 @@
1
+ export declare function downloadBlob(blob: Blob, filename: string): void;
@@ -0,0 +1 @@
1
+ export declare function getApiKey(propKey?: string, demo?: boolean): string;
@@ -0,0 +1,9 @@
1
+ export declare const MIN_TIME_RECORD_ERROR_CODE = "recording.minimum-time-not-reached";
2
+ export declare const MIN_TIME_RECORD_ERROR_MESSAGE = "Minimum recording time has not been reached yet";
3
+ type MinTimeRecordError = Error & {
4
+ code: string;
5
+ };
6
+ export declare function parseTimerToMilliseconds(timer: string): number;
7
+ export declare function isStopBlockedByMinTime(minTimeRecord: number | null | undefined, timer: string, isRecordingActive: boolean): boolean;
8
+ export declare function createMinimumTimeRecordError(): MinTimeRecordError;
9
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { SourceType } from "@vidtreo/recorder";
2
+ declare const DEFAULT_LANGUAGE = "en";
3
+ declare const EMPTY_TEXTS: Record<string, string>;
4
+ declare const START_PREVIEW_DELAY_MILLISECONDS = 100;
5
+ declare const PROGRESS_PERCENT_MULTIPLIER = 100;
6
+ declare const SOURCE_TYPE_CAMERA: SourceType;
7
+ declare const SOURCE_TYPE_SCREEN: SourceType;
8
+ declare const RECORDING_STATE_COUNTDOWN = "countdown";
9
+ declare const RECORDING_STATE_IDLE = "idle";
10
+ declare const RECORDING_STATE_RECORDING = "recording";
11
+ declare const ERROR_CODE_BROWSER_UNSUPPORTED = "browser.unsupported";
12
+ export { DEFAULT_LANGUAGE, EMPTY_TEXTS, START_PREVIEW_DELAY_MILLISECONDS, PROGRESS_PERCENT_MULTIPLIER, SOURCE_TYPE_CAMERA, SOURCE_TYPE_SCREEN, RECORDING_STATE_COUNTDOWN, RECORDING_STATE_IDLE, RECORDING_STATE_RECORDING, ERROR_CODE_BROWSER_UNSUPPORTED, };
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@vidtreo/recorder-vue",
3
+ "version": "1.6.0",
4
+ "type": "module",
5
+ "description": "Vue 3 components and composables for @vidtreo/recorder - video recording SDK",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ },
14
+ "./ssr": {
15
+ "import": "./dist/index.js",
16
+ "types": "./dist/index.d.ts"
17
+ },
18
+ "./styles.css": "./dist/recorder-vue.css"
19
+ },
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "sideEffects": [
24
+ "**/*.css",
25
+ "./dist/index.js"
26
+ ],
27
+ "scripts": {
28
+ "build": "tsdown && vue-tsc --project tsconfig.build.json && bun scripts/rename-css.ts && bun scripts/inject-css.ts",
29
+ "build:dev": "tsdown --watch",
30
+ "dev": "vite --config demo/vite.config.ts",
31
+ "demo": "vite --config demo/vite.config.ts",
32
+ "prepublishOnly": "npm run build"
33
+ },
34
+ "engines": {
35
+ "node": ">=18.0.0"
36
+ },
37
+ "keywords": [
38
+ "video",
39
+ "recording",
40
+ "vue",
41
+ "vue3",
42
+ "composables",
43
+ "components"
44
+ ],
45
+ "license": "MIT",
46
+ "peerDependencies": {
47
+ "@vidtreo/recorder": ">=1.6.0",
48
+ "vue": ">=3.0.0"
49
+ },
50
+ "devDependencies": {
51
+ "@vidtreo/recorder": "workspace:*",
52
+ "@vidtreo/ui-styles": "workspace:*",
53
+ "@vitejs/plugin-vue": "^5.2.1",
54
+ "@phosphor-icons/vue": "^2.2.1",
55
+ "@vue/test-utils": "^2.4.6",
56
+ "happy-dom": "^15.11.7",
57
+ "tsdown": "^0.20.3",
58
+ "@types/node": "^25.2.3",
59
+ "typescript": "^5.9.3",
60
+ "unplugin-vue": "^7.2.0",
61
+ "vite": "^7.3.1",
62
+ "vue": "^3.5.13",
63
+ "vue-tsc": "^3.2.9"
64
+ },
65
+ "publishConfig": {
66
+ "access": "public"
67
+ }
68
+ }