API: Capture Photos & Videos

This sample code allows you to capture photos and videos using the device's native front or rear cameras and store the result locally in Kiosk Pro's Documents folder. Images can also be returned as a Base64 string for easy upload to a database.

Requires

Reference

View API Documentation View API Best Practices

Sample Code

General Functions

Trigger via API Function Result
Check Current Default Camera
Set Front Camera as Default Set Rear Camera as Default
Check Current Flash Mode
Set Flash Mode: Off Set Flash Mode: Auto Set Flash Mode: On

Photo Functions

Trigger via API Function Result
Capture Full Resolution Photo
Capture Photo with Specific Dimensions
Capture Full Resolution Photo with Countdown
Capture Photo with Specific Dimensions & Countdown
Capture Photo & Return Base64 String
Base64 is a text-based image format that can make it easier to store images when working with forms or databases. It can also be used to generate a preview of the captured image file.

While this example uses the call to capture a full resolution image, this function can be combined as needed with any of the photo capture functions above.

Video Functions

Trigger via API Function Result
Capture Video
Capture Video with Countdown
Capture Video & Tap Screen to End Recording