fix camera-preview size issue on iOS (#2296)
Description of Change
This PR fixes an issue with CameraView where the camera preview showed an image of a different size (smaller/larger based on selected resolution) than the one actually captured.
- Fixes #2296
PR Checklist
- [x] Has a linked Issue, and the Issue has been
approved(bug) => not approved yet - [ ] Has tests (if omitted, state reason in description)
- [x] Has samples (if omitted, state reason in description)
- [x] Rebased on top of
mainat time of PR - [x] Changes adhere to coding standard
Thank you for this. I think the better fix is to allow developers to provide this value. Either by an options setting or a property on the CameraView, or both.
Thanks for the review @bijington! To confirm, I’ll add a cross-platform preview-scaling enum on CameraView (mapped to iOS AVLayerVideoGravity and Android PreviewView.ScaleType), expose it as a bindable property and via options, and set this new behavior as the default since the current default is incorrect. Good to proceed?
Sorry I have questions:
- If we have a cross platform enum is there an equivalent for Windows too?
- The original PR only modified iOS does the Android implementation already set the desired behaviour?
- Depending on the answer to the above I'm not sure we should change the default for iOS as that is breaking. Or we at least need to make sure it's what we want and label/advertise it correctly
Hello there,
is there any chance that we get this fix?
Sorry I have questions:
- If we have a cross platform enum is there an equivalent for Windows too?
- The original PR only modified iOS does the Android implementation already set the desired behaviour?
- Depending on the answer to the above I'm not sure we should change the default for iOS as that is breaking. Or we at least need to make sure it's what we want and label/advertise it correctly
-
Currently, no enum exists. We need to introduce one and handle the internal mapping for each platform. I haven’t reviewed the Windows implementation yet.
-
From my testing, Android behaves correctly by default. It’s working fine, although I noticed in the issue thread that someone reported it for Android as well, but I couldn’t reproduce it.
-
The current iOS behavior is incorrect and seems to be a bug. However, fixing it would result in a breaking change.
@bijington