start method

  1. @override
Future<void> start({
  1. required CameraFacing cameraFacing,
  2. List<BarcodeFormat>? formats,
  3. Duration? detectionTimeout,
})
override

Starts streaming video

Implementation

@override
Future<void> start({
  required CameraFacing cameraFacing,
  List<BarcodeFormat>? formats,
  Duration? detectionTimeout,
}) async {
  videoContainer.children = [video];

  if (detectionTimeout != null) {
    frameInterval = detectionTimeout;
  }

  final stream = await initMediaStream(cameraFacing);

  prepareVideoElement(video);
  if (stream != null) {
    await attachStreamToVideo(stream, video);
  }
}