Current behavior:
When clicking the camera rotate (div.rotate) button in Safari 14.0.1, the screen becomes black and the camera stops working. Switching back (to the front camera) is not possible.
Expected behavior:
I would expect that similarly to e.g. Chrome, the camera cannot be switched if only one camera is detected.
Steps to reproduce:
Use pwa-elements in Safari
Start camera
Click
Black screen comes up
Related code:
Not needed. It's reproducible when using 'npm run start' on pwa-elements' main branch.
Other information:
The console will give out the following error:
[Error] TypeError: undefined is not an object (evaluating 'c.facingMode[0]') rotate (pwa-camera.entry.js:404) (anonymous function) (pwa-camera.entry.js:185)
Suggested solution:
Add && facingMode !== undefined solves the problem:
I'm submitting a ... (check one with "x") [x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://stencil-worldwide.slack.com
Current behavior: When clicking the camera rotate (div.rotate) button in Safari 14.0.1, the screen becomes black and the camera stops working. Switching back (to the front camera) is not possible.
Expected behavior: I would expect that similarly to e.g. Chrome, the camera cannot be switched if only one camera is detected.
Steps to reproduce:
Related code: Not needed. It's reproducible when using 'npm run start' on pwa-elements' main branch.
Other information: The console will give out the following error:
[Error] TypeError: undefined is not an object (evaluating 'c.facingMode[0]') rotate (pwa-camera.entry.js:404) (anonymous function) (pwa-camera.entry.js:185)
Suggested solution: Add
&& facingMode !== undefined
solves the problem: