Capture an Image
To launch the native UI to capture an image (or a video) you use the
CameraUI.service.launch function and specify the
MediaType.IMAGE media type.
This will present the appropriate UI to the user.
The result of the user interface will be given through one of the following events:
CameraUIEvent.COMPLETE: When the user completes capture and media data is available
CameraUIEvent.CANCEL: When the user cancels without capturing any image/video
The following code will work across both platforms
Capture a Video
Capturing a video is very similar to capturing an image, except we use the
MediaType.VIDEO media type.
We also can specify some additional options to the video capture, such as video quality as shown in the following example: