stop()

in client/src/components/camera-preview/camera-preview.ts [133:147]


  stop() {
    if (this.videoStream) {
      logger.log('Stopping video stream');
      for (const track of this.videoStream.getTracks()) {
        track.removeEventListener('ended', this.onVideoStreamEnded);
        track.stop();
      }
      this.videoStream = null;
    }
    this.stopVideoResizeTimer();
    if (this.video) {
      this.video.srcObject = null;
    }
    this._status = CameraPreviewStatus.Stopped;
  }