Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set video constraints with height < width on iOS Safari #363

Open
Amethystix opened this issue Dec 27, 2022 · 0 comments
Open

Comments

@Amethystix
Copy link

Amethystix commented Dec 27, 2022

Currently, on iOS safari, I am trying to use a webcam input that allows a user to take photos of documents. To do this, I need the camera to be able to be in a landscape aspect ratio.

Codepen: https://codepen.io/Amethystix/pen/KKBVqOa

Note that it works fine on desktop. Aspect ratio is as expected, size as expected.

On iOS safari however, it refuses to allow a height less than width when environment facing. I forced it to the right size with the object-fit property, but then when the screenshot is taken, the resulting image is stretched.

Note: to get around this, I am also adding object-fit to the resulting image. However the taken image itself does not match the aspect ratio I want, so I still see this as an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant