CameraControl.autoFocus Redirect 1

Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

Summary

This method attempts to focus the camera. If the camera is able to attempt to focus, a success callback is issued, regardless of whether or not the focusing attempt succeeds. If unable to attempt to focus, an error callback is performed instead.

The success or failure of the focus operation is indicated by the value of a parameter passed into the callback function.

Syntax

CameraControl.autoFocus(onsuccess[, onerror]);

Parameters

onsuccess

A callback function called when a focus attempt is made

onerrorOptional

An optional callback function that accepts an error string as an input parameter; this is called if it's not possible to attempt to focus the camera.