public final class VideoRecording

  1. Object
  2. VideoRecording

Handle for an in-progress video recording started via CameraSession#startVideoRecording(String). Call #stop() (fire-and-forget) or #stopAndAwait() (returns the final file path) to finish recording.

Container format is platform-specific: iOS produces .mov, Android .mp4, the JavaScript port .webm. Inspect the file extension of the returned path before consuming the result.

Constructors

public VideoRecording(CameraImpl impl, String requestedPath)Used by platform implementations.

Methods

public void stop()Stop recording without waiting for the file to be finalized.
public AsyncResource<String> stopAndAwait()Stop recording and resolve with the final file path once the file is closed.
public long getElapsedMillis()Milliseconds since the recording started.
public boolean isRecording()True until #stop() or #stopAndAwait() has been called.
public String getRequestedPath()The file path that was requested when the recording started.

Inherited methods

Constructor details

VideoRecording

public VideoRecording(CameraImpl impl, String requestedPath)
Used by platform implementations.

Method details

stop

public void stop()
Stop recording without waiting for the file to be finalized. Use #stopAndAwait() if you need the final file path.

stopAndAwait

public AsyncResource<String> stopAndAwait()
Stop recording and resolve with the final file path once the file is closed.

getElapsedMillis

public long getElapsedMillis()
Milliseconds since the recording started.

isRecording

public boolean isRecording()
True until #stop() or #stopAndAwait() has been called.

getRequestedPath

public String getRequestedPath()
The file path that was requested when the recording started. The actual final path returned by #stopAndAwait() may differ slightly (different extension) depending on the platform’s container format.