Class ICameraController

java.lang.Object
org.zkoss.stateless.state.ICameraController

public class ICameraController extends Object
An ICamera controller to control start, stop, pause, and some status with the given camera instance.

Note: this class is not thread-safe, so when it's used in multi-threading environment, the developer should handle the threading issue.

Author:
katherine
  • Method Details

    • start

      public void start()
      Starts recording.
    • start

      public void start(double delay)
      Starts recording. When camera is off (never call $requestCamera() before), after calling this method, it will request camera permission from user at first, the delay parameter indicates the duration between user permission obtaining and record starting in seconds.
      Parameters:
      delay - the duration between user permission obtaining and record starting in seconds, only meaningful when camera is off
    • stop

      public void stop()
      Stops recording.
    • pause

      public void pause()
      Pauses recording.
    • resume

      public void resume()
      Resumes recording.
    • requestCamera

      public void requestCamera()
      Ask user for permissions to get media stream from camera and microphone.
    • stopStreaming

      public void stopStreaming()
      Stops getting media stream from user's camera and microphone.
    • snapshot

      public void snapshot()
      Takes a snapshot.
    • snapshot

      public void snapshot(double delay)
      Takes a snapshot. When camera is off (never call $requestCamera() before), after calling this method, it will request camera permission from user at first, the delay parameter indicates the duration between user permission obtaining and taking snapshot in seconds.
      Parameters:
      delay - the duration between user permission obtaining and taking snapshot in seconds, only meaningful when camera is off
    • of

      public static ICameraController of(ICamera owner)
      Returns the controller instance with the given camera
      Parameters:
      owner - The controller to control with
    • build

      public ICamera build()
      Returns the immutable camera instance that the controller to build with.
    • isStopped

      public boolean isStopped()
      Returns whether camera is stopped.
      Returns:
      true if the camera is stopped.
    • isPaused

      public boolean isPaused()
      Returns whether camera is paused.
      Returns:
      true if the camera is paused.
    • isRecording

      public boolean isRecording()
      Returns whether camera is recording.
      Returns:
      true if the camera is recording.