stopVideoRecording method Null safety

  1. @override
Future<XFile> stopVideoRecording(
  1. int cameraId
)
override

Stops the video recording and returns the file where it was saved.

Implementation

@override
Future<XFile> stopVideoRecording(int cameraId) async {
  try {
    final XFile videoRecording =
        await getCamera(cameraId).stopVideoRecording();
    await _cameraVideoRecordingErrorSubscriptions[cameraId]?.cancel();
    return videoRecording;
  } on html.DomException catch (e) {
    throw PlatformException(code: e.name, message: e.message);
  } on CameraWebException catch (e) {
    _addCameraErrorEvent(e);
    throw PlatformException(code: e.code.toString(), message: e.description);
  }
}