SL4A API Help -WebCamFacade

index
Manages access to camera streaming.

Usage Notes


webCamStart and webCamStop are used to start and stop an Mpeg stream on a given port. webcamAdjustQuality is used to ajust the quality of the streaming video.
cameraStartPreview is used to get access to the camera preview screen. It will generate "preview" events as images become available.
The preview has two modes: data or file. If you pass a non-blank, writable file path to the cameraStartPreview it will store jpg images in that folder. It is up to the caller to clean up these files after the fact. If no file element is provided, the event will include the image data as a base64 encoded string.

Event details


The data element of the preview event will be a map, with the following elements defined.
Note that "filename", "error" and "data" are mutual exclusive.

The webcam and preview modes use the same resources, so you can't use them both at the same time. Stop one mode before starting the other.
Min SDK level=8
@author Damon Kohler (damonkohler@gmail.com) (probably)
@author Robbie Matthews (rjmatthews62@gmail.com)
cameraStartPreviewStart Preview Mode. Throws \'preview\' events.
resolutionLevel (Integer) increasing this number provides higher resolution (default=0)
jpegQuality (Integer) a number from 0-100 (default=20)
filepath (String) Path to store jpeg files. (optional)
returns: (boolean) True if successful
cameraStopPreviewStop the preview mode.
webcamAdjustQualityAdjusts the quality of the webcam stream while it is running.
resolutionLevel (Integer) increasing this number provides higher resolution (default=0)
jpegQuality (Integer) a number from 0-100 (default=20)
webcamStartStarts an MJPEG stream and returns a Tuple of address and port for the stream.
resolutionLevel (Integer) increasing this number provides higher resolution (default=0)
jpegQuality (Integer) a number from 0-100 (default=20)
port (Integer) If port is specified, the webcam service will bind to port, otherwise it will pick any available port. (default=0)
webcamStopStops the webcam stream.

index