kvision / pl.treksoft.kvision.cordova / MediaCapture

MediaCapture

object MediaCapture

Main media capture object.

Types

CaptureErrorCode

enum class CaptureErrorCode

Functions

addPendingCaptureListener

fun addPendingCaptureListener(listener: (Result<List<MediaFile>, CaptureException>) -> Unit): Unit

Add listeners for pending capture Cordova events.

captureAudio

suspend fun captureAudio(limit: Number = 1, duration: Number? = null): Result<List<MediaFile>, CaptureException>

Capture audio file(s).

captureImage

suspend fun captureImage(limit: Number = 1): Result<List<MediaFile>, CaptureException>

Capture image file(s).

captureVideo

suspend fun captureVideo(limit: Number = 1, duration: Number? = null, lowQuality: Boolean = false): Result<List<MediaFile>, CaptureException>

Capture video file(s).

Extension Functions

createInstance

fun <T> Any?.createInstance(vararg args: dynamic): T

Helper function for creating JavaScript objects from dynamic constructors.