-
Notifications
You must be signed in to change notification settings - Fork 17
SL4A WebCamFacade
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.
- format - currently always "jpeg"
- width - image width (in pixels)
- height - image height (in pixels)
- quality - JPEG quality. Number from 1-100
- filename - Name of file where image was saved. Only relevant if filepath defined.
- error - included if there was an IOException saving file, ie, disk full or path write protected.
- encoding - Data encoding. If filepath defined, will be "file" otherwise "base64"
- data - Base64 encoded image data.
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