camera-preview icon indicating copy to clipboard operation
camera-preview copied to clipboard

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'videoWidth')

Open ch3njust1n opened this issue 1 year ago • 3 comments

Describe the bug Sample video code does not work. Cannot read videoWidth.

const cameraPreviewOptions: CameraPreviewOptions = {
    position: 'rear',
    parent: 'cameraPreview',
    className: 'cameraPreview',
    height: this.height,
    width: this.width
};

CameraPreview.start(cameraPreviewOptions);

const cameraSampleOptions: CameraSampleOptions = {
    quality: 50
};

while(this.isActive) {
    const image = await CameraPreview.captureSample(cameraSampleOptions)
    console.log(image.value)
}

To Reproduce Steps to reproduce the behavior:

  1. Run sample video code
  2. Open in browser

Expected behavior I expected a frame of the video to be captured.

Desktop (please complete the following information):

  • OS: macOS Monterey
  • Brave
  • Version 1.41.96 Chromium 103.0.5060.114

Smartphone (please complete the following information):

  • Device: Samsung
  • OS: Android Galaxy S10+

Additional context Screen Shot 2022-07-19 at 10 21 24 PM

ch3njust1n avatar Jul 20 '22 02:07 ch3njust1n

I get an occasional error just like this with my PWA, but I'm using Capture, not captureSample. Any answers?

Zaphod-Beeblebrox avatar Dec 02 '22 20:12 Zaphod-Beeblebrox

+1 i get this in Capture and captureSample.

mrcashcash avatar Aug 19 '23 14:08 mrcashcash

same error for me as well, any update ??

venna-kalyani avatar Apr 22 '24 19:04 venna-kalyani