Package org.zkoss.stateless.state
Class ICameraController
- java.lang.Object
-
- org.zkoss.stateless.state.ICameraController
-
public class ICameraController extends java.lang.ObjectAnICameracontroller 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ICamerabuild()Returns the immutable camera instance that the controller to build with.booleanisPaused()Returns whether camera is paused.booleanisRecording()Returns whether camera is recording.booleanisStopped()Returns whether camera is stopped.static ICameraControllerof(ICamera owner)Returns the controller instance with the givencameravoidpause()Pauses recording.voidrequestCamera()Ask 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.voidstopStreaming()Stops getting media stream from user's camera and microphone.
-
-
-
Method Detail
-
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 givencamera- 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.
-
-