Recorder

interface Recorder

Records a single video to a file, see CameraVideoOutput.createRecorder. To record several videos, create several Recorders.

Properties

Link copied to clipboard
abstract val filePath: String

The absolute filesystem path this recorder records (or will record) to.

Link copied to clipboard
abstract val isPaused: Boolean

Whether the current recording is paused.

Link copied to clipboard
abstract val isRecording: Boolean

Whether this recorder is currently recording.

Link copied to clipboard

The duration recorded so far, or zero if not isRecording.

Link copied to clipboard
abstract val recordedFileSize: Long

The size of the file recorded so far, in bytes, or 0 if not isRecording.

Functions

Link copied to clipboard
abstract suspend fun cancelRecording()

Cancels the current recording and deletes its file.

Link copied to clipboard
abstract suspend fun pauseRecording()

Requests the recording to pause. onRecordingPaused is called once it actually paused.

Link copied to clipboard
abstract suspend fun resumeRecording()

Requests the paused recording to resume. onRecordingResumed is called once it actually resumed.

Link copied to clipboard
abstract suspend fun startRecording(onRecordingFinished: (filePath: String, reason: RecordingFinishedReason) -> Unit, onRecordingError: (error: Throwable) -> Unit, onRecordingPaused: () -> Unit? = null, onRecordingResumed: () -> Unit? = null)

Starts recording. Returns once the recording has started.

Link copied to clipboard
abstract suspend fun stopRecording()

Requests the recording to stop. onRecordingFinished is called once it actually stopped.