ionic-team / pwa-elements

Quality UI experiences for Web APIs that require custom UI (such as media/camera).
https://medium.com/@maxlynch/building-the-progressive-web-app-os-57daebcb69c1
MIT License
168 stars 50 forks source link

Camera Modal Cancel (Retake) Button JS Error #40

Closed amohseng closed 4 years ago

amohseng commented 5 years ago

-- @stencil/core@1.4.0



**I'm submitting a ...**  (check one with "x")
[x] bug report

**Current behavior:**
1- On Click the Cancel (Retake) Button in the Camera Footer (Not the Close Button in the Camera Header), The Camera Modal Preview Shows a black screen, however you can still capture a picture.

2- Then, If you click Rotate Button in the Camera Footer you will get the following js error:

Uncaught (in promise) TypeError: Cannot set property 'srcObject' of null
    at CameraPWA.initStream (pwa-camera.entry.js:222)
    at CameraPWA.initCamera (pwa-camera.entry.js:214)

3- Then, if you try to Capture again, 
Unable to take photo! DOMException
pwa-camera.entry.js:259

**Expected behavior:**
On Click the Cancel (Retake) Button in the Camera Footer, you get the normal preview and be able to capture again.

**Steps to reproduce:**
Use Ionic4 + Angular 8 + Capacitor + pwa-elements 
shlomir commented 4 years ago

Same here. Is there any workaround for it?