kvision / pl.treksoft.kvision.cordova / Camera

Camera

object Camera

Main object for Cordova camera.

Types

CameraPopoverOptions

data class CameraPopoverOptions

iOS popover options.

DestinationType

enum class DestinationType

Camera destination types.

Direction

enum class Direction

Camera facing types.

EncodingType

enum class EncodingType

Picture encoding types.

MediaType

enum class MediaType

Picture/video media types.

PictureSourceType

enum class PictureSourceType

Camera picture/video sources.

PopoverArrowDirection

enum class PopoverArrowDirection

iOS popover arrow directions.

Functions

addCameraResultCallback

fun addCameraResultCallback(resultCallback: (Result<String, CameraException>) -> Unit): Unit

An Android specific function to get picture from the camera after resume when the application webview intent is killed.

cleanup

fun cleanup(resultCallback: ((Result<String, CameraException>) -> Unit)? = null): Unit

Removes intermediate image files that are kept in the temporary storage after calling getPicture.

getPicture

suspend fun getPicture(options: CameraOptions): Result<String, CameraException>

Suspending function to get picture from the camera.

fun getPicture(options: CameraOptions, resultCallback: (Result<String, CameraException>) -> Unit): Unit

A function to get picture from the camera.

Extension Functions

createInstance

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

Helper function for creating JavaScript objects from dynamic constructors.