When the SDK is first initialised, it will attempt to open each camera on the device in turn and establish which capture resolutions are available for use. In the event the device doesn’t have any suitable capture devices, the camera and smart capture providers will be disabled.
When the device capabilities have changed, and event is broadcast with the available cameras capabilities listed inside. The CAMERA:CAPABILITIES_UPDATED
event includes minimum and maximum resolutions, frame rates and aspect ratios as well as the device id and name.
Due to some devices having multiple cameras for the user to choose from, it is advisable to suggest to your users that they should ensure the correct camera is visible in the viewfinder before beginning the process. There are many ways of doing this:
Adding content into the templates
You can modify the camera templates for each step to add in custom text for your users to advice them which camera they should be using for the current step. You could also have a dialog of sorts which would require the user to acknowledge they have understood the message, and remove it from the template with some simple javascript.
Listening for events
You could listen to the aforementioned events, and when the user is shown one of the templates where a camera is required, you can use the known number of cameras to decide whether to display a dialog for the user to read suggesting a suitable camera for them to use.