Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Latest commit

 

History

History
180 lines (105 loc) · 6.46 KB

README.md

File metadata and controls

180 lines (105 loc) · 6.46 KB

capacitor-video-recorder

Library that enables video recording in native Capacitor apps using the built in vindeo recorder abilities on Android and iOS

Install

npm install capacitor-video-recorder
npx cap sync

API

getVideo(...)

getVideo(options: VideoOptions) => Promise<Video>

Prompt the user to pick a video from an album, or take a new video with the camera.

Param Type
options VideoOptions

Returns: Promise<Video>

Since: 0.0.1


pickVideos(...)

pickVideos(options: GalleryVideoOptions) => Promise<Videos>

Allows the user to pick multiple videos from the gallery. On iOS 13 and older it only allows to pick one video.

Param Type
options GalleryVideoOptions

Returns: Promise<Videos>

Since: 0.0.1


checkPermissions()

checkPermissions() => Promise<PermissionStatus>

Check camera and video album permissions

Returns: Promise<PermissionStatus>

Since: 0.0.1


requestPermissions(...)

requestPermissions(permissions?: VideoRecorderPluginPermissions | undefined) => Promise<PermissionStatus>

Request camera and video album permissions

Param Type
permissions VideoRecorderPluginPermissions

Returns: Promise<PermissionStatus>

Since: 0.0.1


Interfaces

Video

Prop Type Description Since
path string If using CameraResultType.Uri, the path will contain a full, platform-specific file URL that can be read later using the Filesystem API. 0.0.1
webPath string webPath returns a path that can be used to set the src attribute of an video for efficient loading and rendering. 0.0.1

VideoOptions

Prop Type Description Default Since
source VideoSource The source to get the video from. By default this prompts the user to select either the video album or take a video. : VideoSource.Prompt 0.0.1

Videos

Prop Type Description Since
photos Video[] Array of all the picked videos. 0.0.1

GalleryVideoOptions

Prop Type Description Default Since
presentationStyle 'fullscreen' | 'popover' iOS only: The presentation style of the Camera. : 'fullscreen' 0.0.1
limit number iOS only: Maximum number of videos the user will be able to choose. 0 (unlimited) 0.0.1

PermissionStatus

Prop Type
camera VideoPermissionState
photos VideoPermissionState

VideoRecorderPluginPermissions

Prop Type
permissions VideoPermissionType[]

Type Aliases

VideoPermissionState

PermissionState | 'limited'

PermissionState

'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'

VideoPermissionType

'camera' | 'videos'

Enums

VideoSource

Members Value Description
Prompt "PROMPT" Prompts the user to select either the video album or take a video.
Camera "CAMERA" Take a new video using the camera.
Videos "VIDEOS" Pick an existing video from the gallery or video album.