CameraControl.resumeRecording()

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

Summary

The resumeRecording() method of the CameraControl interface is used to resume the recording of a video stream that has previously been paused.

If this method is called when the camera is recording or not paused, it fails silently.

Syntax

JavaScript
CameraControl.resumeRecording();

Parameters

None.

Returns

Void.

Example

This example records up to 1 GB or 1 hour of video, storing it in the standard videos store on the device. Note the use of navigator.getDeviceStorage() to determine the storage location for the video, and the pause and resume controls.

JavaScript
var storage = navigator.getDeviceStorage('videos');
var cameraOptions = {
  camera: navigator.mozCameras.getListOfCameras()[0]
};
var recordOptions = {
  rotation: 0,
  maxFileSizeBytes: 1024 * 1024 * 1024 // 1 GB
  maxVideoLengthMs: 1000 * 60 * 60     // 1 hour
}

function onRecordStart() {
  console.log("The device is recording the video output from the camera");
}

function onStateChange( newState ) {
  console.log("The recorder state change: " + newState);
}

function onAccessCamera( camera ) {
  camera.startRecording(recordOptions, storage, 'myVideo.3gp', onRecordStart);
  camera.onRecorderStateChange = onStateChange;

  pauseBtn.onclick = function() {
    camera.pauseRecording();
  }

  resumeBtn.onclick = function() {
    camera.resumeRecording();
  }
};

navigator.mozCameras.getCamera(cameraOptions, onAccessCamera)

Specification

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

Browser support

note that this method was added in Firefox OS 2.5.

See also

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/api/cameracontrol/resumerecording

API B2G Camera camera DOM Firefox OS Graphics Method Non-standard Reference