We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

CameraManager.getCamera Redirect 1

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.

This API is available on Firefox OS for certified applications only.


This method is used to access to one of the cameras available on the device based on its identifier. You can get a list of the available cameras by calling the CameraManager.getListOfCameras() method.


CameraManager.getCamera(options, onsuccess[, onerror]);


An object containing a property camera with the identifier of the camera to use.
A callback function that take a CameraControl object as parameter.
An optional callback function that accepts an error string as a parameter.


var options = {
  camera: navigator.mozCameras.getListOfCameras()[0]

function onSuccess(camera) {
  // Do stuff with the camera

function onError(error) {

navigator.mozCameras.getCamera(options, onSuccess, onError)


Not part of any specification; however, this API should be removed when the WebRTC Capture and Stream API has been implemented.

See also

Document Tags and Contributors

Last updated by: Sheppy,