lock method

Future<void> lock()

Re-locks the camera to prevent other processes from accessing it.

Camera objects are locked by default unless unlock is called. Normally reconnect is used instead.

Camera is automatically locked for applications in MediaRecorder.start. Applications can use the camera (ex: zoom) after recording starts. There is no need to call this after recording starts or stops.

If you are not recording video, you probably do not need this method.

If the camera cannot be re-locked (for example, if the camera is still in use by another process) this throws a PlatformException.

Implementation

Future<void> lock() {
  return _channel.$lock(this);
}