Package org.zkoss.stateless.state
Class ICameraController
java.lang.Object
org.zkoss.stateless.state.ICameraController
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 Summary
Modifier and TypeMethodDescriptionbuild()Returns the immutable camera instance that the controller to build with.booleanisPaused()Returns whether camera is paused.booleanReturns whether camera is recording.booleanReturns whether camera is stopped.static ICameraControllerReturns the controller instance with the givencameravoidpause()Pauses recording.voidAsk user for permissions to get media stream from camera and microphone.voidresume()Resumes recording.voidsnapshot()Takes a snapshot.voidsnapshot(double delay) Takes a snapshot.voidstart()Starts recording.voidstart(double delay) Starts recording.voidstop()Stops recording.voidStops getting media stream from user's camera and microphone.
-
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
Returns the controller instance with the givencamera- Parameters:
owner- The controller to control with
-
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.
-