Class VideoRecording

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

public final class VideoRecording extends java.lang.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 Summary

    Constructors
    Constructor
    Description
    VideoRecording(com.codename1.impl.CameraImpl impl, String requestedPath)
    Used by platform implementations.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Milliseconds since the recording started.
    The file path that was requested when the recording started.
    boolean
    True until #stop() or #stopAndAwait() has been called.
    void
    Stop recording without waiting for the file to be finalized.
    Stop recording and resolve with the final file path once the file is closed.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.