Class VideoRecording

java.lang.Object
com.codename1.camera.VideoRecording

public final class VideoRecording extends Object

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.

  • Constructor Details

    • VideoRecording

      public VideoRecording(com.codename1.impl.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.