ensemble-ios-video-recorder
v1.0.0
Published
Allows video preview, capture, flip camera, etc. on ios devices with a mobile focus.
Downloads
1,100
Maintainers
Readme
ensemble-ios-video-recorder
Allows video preview, capture, flip camera, etc. on ios devices with a mobile focus.
Install
npm install ensemble-ios-video-recorder
npx cap sync
API
initialize(...)
destroy()
flipCamera()
addPreviewFrameConfig(...)
editPreviewFrameConfig(...)
switchToPreviewFrame(...)
showPreviewFrame()
hidePreviewFrame()
prepareRecording(...)
startRecording(...)
stopRecording()
- 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() => Promise<void>
hidePreviewFrame()
hidePreviewFrame() => Promise<void>
prepareRecording(...)
prepareRecording(e: { outputFileStem: string; projectUUID: string; }) => Promise<string>
| Param | Type |
| ------- | ------------------------------------------------------------- |
| e
| { outputFileStem: string; projectUUID: string; } |
Returns: Promise<string>
startRecording(...)
startRecording(e: { outputFileStem: string; projectUUID: string; }) => Promise<void>
| Param | Type |
| ------- | ------------------------------------------------------------- |
| e
| { outputFileStem: string; projectUUID: string; } |
stopRecording()
stopRecording() => Promise<{ "videoUrl": string; }>
Returns: Promise<{ videoUrl: string; }>
Interfaces
VideoRecorderOptions
| Prop | Type |
| ------------------- | --------------------------------------------------------------------- |
| id
| string |
| camera
| VideoRecorderCamera |
| quality
| VideoRecorderQuality |
| autoShow
| boolean |
| previewFrames
| VideoRecorderPreviewFrame[] |
| stackPosition
| 'front' | 'back' |
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; } |
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 |