stop method

Future stop()

Implementation

Future stop() async {
  try {
    if (stream == null) return;
    Log().debug("Stopping Camera");
    video.pause();
    if (stream != null) {
      stream!.getTracks().forEach((track) => track.stop());
    }
    stream = null;
    Log().debug("Camera Stopped");
  } catch (e) {
    Log().debug('$e');
  }
}