@studiokloek/capacitor-plugin-mediacapture
v6.0.2
Published
test
Downloads
4
Readme
@studiokloek/capacitor-plugin-mediacapture
This capacitor plugin allows iOS applications to capture media from the camera and microphone.
Install
yarn add @studiokloek/capacitor-plugin-mediacapture
npx cap sync
API
checkPermissions()
requestPermissions(...)
startCameraSession(...)
stopCameraSession()
showCameraPreview(...)
hideCameraPreview(...)
startCameraRecording(...)
stopCameraRecording()
grabCameraImage(...)
startMicrophoneSession(...)
stopMicrophoneSession()
startMicrophoneRecording(...)
stopMicrophoneRecording()
- Interfaces
- Type Aliases
checkPermissions()
checkPermissions() => Promise<PermissionStatus>
Returns: Promise<PermissionStatus>
requestPermissions(...)
requestPermissions(permissions?: MediaCapturePluginPermissions | undefined) => Promise<PermissionStatus>
| Param | Type |
| ----------------- | --------------------------------------------------------------------------------------- |
| permissions
| MediaCapturePluginPermissions |
Returns: Promise<PermissionStatus>
startCameraSession(...)
startCameraSession(options: CameraSessionOptions) => Promise<boolean>
| Param | Type |
| ------------- | --------------------------------------------------------------------- |
| options
| CameraSessionOptions |
Returns: Promise<boolean>
stopCameraSession()
stopCameraSession() => Promise<boolean>
Returns: Promise<boolean>
showCameraPreview(...)
showCameraPreview(options: CameraPreviewShowOptions) => Promise<boolean>
| Param | Type |
| ------------- | ----------------------------------------------------------------------------- |
| options
| CameraPreviewShowOptions |
Returns: Promise<boolean>
hideCameraPreview(...)
hideCameraPreview(options: CameraPreviewHideOptions) => Promise<boolean>
| Param | Type |
| ------------- | ----------------------------------------------------------------------------- |
| options
| CameraPreviewHideOptions |
Returns: Promise<boolean>
startCameraRecording(...)
startCameraRecording(options: StartCameraRecordingOptions) => Promise<boolean>
| Param | Type |
| ------------- | ----------------------------------------------------------------------------------- |
| options
| StartCameraRecordingOptions |
Returns: Promise<boolean>
stopCameraRecording()
stopCameraRecording() => Promise<undefined | CameraRecordingResult>
Returns: Promise<CameraRecordingResult>
grabCameraImage(...)
grabCameraImage(options: GrabCameraImageOptions) => Promise<undefined | GrabCameraImageResult>
| Param | Type |
| ------------- | ------------------------------------------------------------------------- |
| options
| GrabCameraImageOptions |
Returns: Promise<GrabCameraImageResult>
startMicrophoneSession(...)
startMicrophoneSession(options: MicrophoneSessionOptions) => Promise<boolean>
| Param | Type |
| ------------- | ----------------------------------------------------------------------------- |
| options
| MicrophoneSessionOptions |
Returns: Promise<boolean>
stopMicrophoneSession()
stopMicrophoneSession() => Promise<boolean>
Returns: Promise<boolean>
startMicrophoneRecording(...)
startMicrophoneRecording(options: StartMicrophoneRecordingOptions) => Promise<boolean>
| Param | Type |
| ------------- | ------------------------------------------------------------------------------------------- |
| options
| StartMicrophoneRecordingOptions |
Returns: Promise<boolean>
stopMicrophoneRecording()
stopMicrophoneRecording() => Promise<undefined | MicrophoneRecordingResult>
Returns: Promise<MicrophoneRecordingResult>
Interfaces
PermissionStatus
| Prop | Type |
| ---------------- | ----------------------------------------------------------------------------------- |
| camera
| MediaCapturePermissionState |
| photos
| MediaCapturePermissionState |
| microphone
| MediaCapturePermissionState |
MediaCapturePluginPermissions
| Prop | Type |
| ----------------- | ----------------------------------------- |
| permissions
| MediaCapturePermissionType[] |
CameraSessionOptions
| Prop | Type |
| --------------------- | -------------------- |
| audio
| boolean |
| video
| boolean |
| photo
| boolean |
| preset
| string |
| position
| string |
| fullFramePhotos
| boolean |
CameraPreviewShowOptions
| Prop | Type |
| -------------------------- | --------------------------------------------------------------------- |
| frame
| { x: number; y: number; width: number; height: number; } |
| gravity
| string |
| fadeDuration
| number |
| useDeviceOrientation
| boolean |
CameraPreviewHideOptions
| Prop | Type |
| ------------------ | ------------------- |
| fadeDuration
| number |
StartCameraRecordingOptions
| Prop | Type |
| -------------------------- | -------------------- |
| autoSave
| boolean |
| duration
| number |
| useDeviceOrientation
| boolean |
CameraRecordingResult
| Prop | Type |
| --------- | ------------------- |
| url
| string |
GrabCameraImageResult
| Prop | Type |
| --------- | ------------------- |
| url
| string |
GrabCameraImageOptions
| Prop | Type |
| -------------------------- | -------------------- |
| autoSave
| boolean |
| useDeviceOrientation
| boolean |
| autoAdjust
| boolean |
MicrophoneSessionOptions
| Prop | Type |
| ------------------- | -------------------- |
| sampleRate
| number |
| reuseRecorder
| boolean |
| numChannels
| number |
StartMicrophoneRecordingOptions
| Prop | Type |
| -------------- | ------------------- |
| duration
| number |
MicrophoneRecordingResult
| Prop | Type |
| --------- | ------------------- |
| url
| string |
Type Aliases
MediaCapturePermissionState
PermissionState | 'limited'
PermissionState
'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'
MediaCapturePermissionType
'camera' | 'photos' | 'microphone'