kvision / pl.treksoft.kvision.cordova / Media

Media

external class Media

Cordova media class.

Constructors

<init>

Media(src: String, mediaSuccess: (() -> Unit)? = definedExternally, mediaError: ((MediaError) -> Unit)? = definedExternally, mediaStatus: ((Int) -> Unit)? = definedExternally)

Cordova media class.

Properties

duration

val duration: Number

position

val position: Number

Functions

getCurrentAmplitude

fun getCurrentAmplitude(mediaSuccess: (Number) -> Unit, mediaError: ((Int) -> Unit)? = definedExternally): Unit

getCurrentPosition

fun getCurrentPosition(mediaSuccess: (Number) -> Unit, mediaError: ((Int) -> Unit)? = definedExternally): Unit

getDuration

fun getDuration(): Number

pause

fun pause(): Unit

pauseRecord

fun pauseRecord(): Unit

play

fun play(): Unit

release

fun release(): Unit

resumeRecord

fun resumeRecord(): Unit

seekTo

fun seekTo(millis: Number): Unit

setRate

fun setRate(rate: Number): Unit

setVolume

fun setVolume(volume: Number): Unit

startRecord

fun startRecord(): Unit

stop

fun stop(): Unit

stopRecord

fun stopRecord(): Unit

Companion Object Properties

MEDIA_NONE

val MEDIA_NONE: Int

MEDIA_PAUSED

val MEDIA_PAUSED: Int

MEDIA_RUNNING

val MEDIA_RUNNING: Int

MEDIA_STARTING

val MEDIA_STARTING: Int

MEDIA_STOPPED

val MEDIA_STOPPED: Int

Extension Functions

createInstance

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

Helper function for creating JavaScript objects from dynamic constructors.

getCurrentAmplitude

suspend fun Media.getCurrentAmplitude(): Number

Returns the current amplitude within an audio file.

getCurrentPosition

suspend fun Media.getCurrentPosition(): Number

Returns the current position within an audio file.