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

fix: camera rotate not working on safari #75

Closed jankal13 closed 2 years ago

jankal13 commented 3 years ago

As described in #74, there are issues rotating the camera in a Safari browser. Adding a small change to the code solves this problem.

pfeigl commented 3 years ago

Just browsing this due to me looking at another issue.

@mrzyte While your fix resolves the error, I think it is not the right thing todo. You just disable reading the capabilities completely, when the facingMode could not be identified by the getConstraints call.

Shouldn't you better check inside of the if whether the call to getCapabilities returned something reasonable instead of skipping the whole thing?

jcesarmobile commented 2 years ago

I've sent a similar PR that checks if capabilities returned facingMode. https://github.com/ionic-team/pwa-elements/pull/95

Also, looks like there is a missing closing bracket or your forgot to delete/replace the previous line