@capacitor-community/video-recorder
v5.0.1
Published
capacitor plugin to record video
Downloads
513
Maintainers
Readme
capacitor plugin to record video
Install
npm install @capacitor-community/video-recorder
npx cap sync
API
initialize(...)
destroy()
flipCamera()
addPreviewFrameConfig(...)
editPreviewFrameConfig(...)
switchToPreviewFrame(...)
showPreviewFrame(...)
hidePreviewFrame()
startRecording()
stopRecording()
getDuration()
addListener('onVolumeInput', ...)
- Interfaces
- Enums
initialize(...)
initialize(options?: VideoRecorderOptions | undefined) => Promise<void>
| Param | Type |
| ------------- | --------------------------------------------------------------------- |
| options
| VideoRecorderOptions |
destroy()
destroy() => Promise<void>
flipCamera()
flipCamera() => Promise<void>
addPreviewFrameConfig(...)
addPreviewFrameConfig(config: VideoRecorderPreviewFrame) => Promise<void>
| Param | Type |
| ------------ | ------------------------------------------------------------------------------- |
| config
| VideoRecorderPreviewFrame |
editPreviewFrameConfig(...)
editPreviewFrameConfig(config: VideoRecorderPreviewFrame) => Promise<void>
| Param | Type |
| ------------ | ------------------------------------------------------------------------------- |
| config
| VideoRecorderPreviewFrame |
switchToPreviewFrame(...)
switchToPreviewFrame(options: { id: string; }) => Promise<void>
| Param | Type |
| ------------- | ---------------------------- |
| options
| { id: string; } |
showPreviewFrame(...)
showPreviewFrame(config: { position: number; quality: number; }) => Promise<void>
| Param | Type |
| ------------ | --------------------------------------------------- |
| config
| { position: number; quality: number; } |
hidePreviewFrame()
hidePreviewFrame() => Promise<void>
startRecording()
startRecording() => Promise<void>
stopRecording()
stopRecording() => Promise<{ videoUrl: string; }>
Returns: Promise<{ videoUrl: string; }>
getDuration()
getDuration() => Promise<{ value: number; }>
Returns: Promise<{ value: number; }>
addListener('onVolumeInput', ...)
addListener(eventName: 'onVolumeInput', listenerFunc: (event: { value: number; }) => void) => PluginListenerHandle
| Param | Type |
| ------------------ | --------------------------------------------------- |
| eventName
| 'onVolumeInput' |
| listenerFunc
| (event: { value: number; }) => void |
Returns: PluginListenerHandle
Interfaces
VideoRecorderOptions
| Prop | Type |
| ------------------- | --------------------------------------------------------------------- |
| camera
| VideoRecorderCamera |
| quality
| VideoRecorderQuality |
| autoShow
| boolean |
| previewFrames
| VideoRecorderPreviewFrame[] |
VideoRecorderPreviewFrame
| Prop | Type |
| ------------------- | ------------------------------------------------------------------- |
| id
| string |
| stackPosition
| 'front' | 'back' |
| x
| number |
| y
| number |
| width
| number | 'fill' |
| height
| number | 'fill' |
| borderRadius
| number |
| dropShadow
| { opacity?: number; radius?: number; color?: string; } |
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove
| () => Promise<void> |
Enums
VideoRecorderCamera
| Members | Value |
| ----------- | -------------- |
| FRONT
| 0 |
| BACK
| 1 |
VideoRecorderQuality
| Members | Value |
| --------------- | -------------- |
| MAX_480P
| 0 |
| MAX_720P
| 1 |
| MAX_1080P
| 2 |
| MAX_2160P
| 3 |
| HIGHEST
| 4 |
| LOWEST
| 5 |
| QVGA
| 6 |