-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[camera] Options to scan for physical and/or logical cameras on iOS #6023
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
Conversation
My primary feedback, which continues to be true, is that this needs a full design proposal (https://github.com/flutter/flutter/wiki/Design-Documents). There are many possible ways to handle different device types, and this PR would lock us into a specific one without there having been a discussions of alternatives and the pros and cons of each.
If we can't confidently answer the question of whether this API will apply well to other platforms, that's a strong signal that this hasn't gone through sufficient evaluation yet. See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#platform-support
Our priority is the long term health and usability of the plugin's API surface; our process is designed to support that rather than patchworks of APIs developed in small pieces based on individual contributor deadlines, as cases where the latter has happened the outcomes have often not been good. |
I took a quick look at MDN, and I don't think there's a concept of Logical/Physical Cameras in the Web. Cameras (and other types) are just providers of a MediaStream that can be connected to a Canvas or a WebRTC connection. There's also no "constraint" to select physical from logical cameras. See: MediaTrackConstraints. (It wouldn't be the first time that the web ignores values from some parameters, though!) |
Marking as a draft pending a design document, per comment above. |
(triage): I am going to close this one since there hasn't been any follow-up. If you find the time to address the feedback given above please reopen this. Thank you. |
Based on feedback from @stuartmorgan, I have refactored my original PRs (#5957 and #5958) to not disrupt the existing functionality of the availableDevices method, while still providing the option to access the extended list of iOS cameras (both physical and logical) based on Apple's documentation:
https://developer.apple.com/documentation/avfoundation/avcapturedevice/devicetype
This changes hopefully make room to eventually add the ability to access logical cameras on Android (or other?) devices at some point, but the changes on iOS were more pressing for my project so I wanted to at least start there.
I've included external cameras as "physical devices" so this PR should fix the same issue as #5892.
List which issues are fixed by this PR. You must list at least one issue.
closes flutter/flutter#134151
closes flutter/flutter#130073
closes flutter/flutter#142025
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].CHANGELOG.md
to add a description of the change, [following repository CHANGELOG style].///
).