Camera view initial work (iOS)#1387
Camera view initial work (iOS)#1387Dresel wants to merge 12 commits intoCommunityToolkit:pj/cameraView-initial-workfrom
Conversation
| { | ||
| ArgumentNullException.ThrowIfNull(photoOutput); | ||
|
|
||
| var wrapper = new AVCapturePhotoCaptureDelegateWrapper(); |
There was a problem hiding this comment.
Instead of creating a new delegate each time, how about we create a new TaskCompletionSource every time and keep one instance of the delegate?
There was a problem hiding this comment.
How would you handle concurrent flows / multiple tcs?
There was a problem hiding this comment.
I could also implement AVCapturePhotoCaptureDelegate on the CameraManager if you prefer that.
There was a problem hiding this comment.
How would you handle concurrent flows / multiple tcs?
This code should run on UIThread, so I don't think we'll have concurrent flows... Or iOS allow the camera to be triggered from a background thread?
I could also implement AVCapturePhotoCaptureDelegate on the CameraManager if you prefer that.
Need more time to think about it
|
@pictos I have integrated your feedback and added flash mode for ios. I have also created a gallery page (Views / Camera View). Do we want to handle permissions? Or do we assume that the user only uses the camera view if permissions are granted? Cleanup / Error handling is still on my to-do but apart from that I think the ios implementation is good to go. Waiting for a colleague so I can test on macOS / MacBook. |
|
My colleague did check on macOS - apart from that flash modes might not be supported - everything works identical as on the iOS device. We use the first supported flash mode as fallback if the given flash mode is not found. Might be something for the next api proposal (supported flash modes). |
|
@pictos Should I go on with the windows implementation? Should I wait for feedback and further iOS requests / changes? What do you think? |
I'm happy to take a look at the current changes. If you are up for it and available then I would say please go ahead with the windows bits too. Thank you |
Would you consider a (preview) release without a windows implementation or is this mandatory? Asking for a customer who is not in the need of a windows implementation. |
@Dresel if there's a Windows control for CamareView (which I believe there isn't) we should implement it. I'll double-check if the winui team released something |
|
@Dresel I'm aware of that repo, but we will not go to that path, where we need to create a CameraControl, we want to use whatever the platform gives to us. That said, we (probably) will not ship the CameraView for Windows until the winui team provides a control for it. |
|
I only found the "semi official" camera preview from the CommunityToolkit Windows repository which I guess we won't include? |
|
No, we're following this issue microsoft/microsoft-ui-xaml#4710 |
|
So I guess the Windows part is off the table? Just let me know if there is anything I can do to advance / finish this PR. What about CameraLocation? Is this just for testing purpose or something you want to publish (couldn't find it in the initial proposal)? |
|
@peruchali yes, that's the plan |
|
Hi, Thank you |
|
What is the status of this? @pictos I see you had some review comments left. Is there anything I can pick up to assist getting this completed? |
|
@bijington can't remember on the top of my mind, need to take a look into it and see... Will find find time to review this week |
|
@bijington @pictos I'm still eager to help - let me know if there is something for me to do. |
Why can't we use either https://github.com/CommunityToolkit/Windows/blob/ce82ac235bded01f8bc2f2b6ff64a5b0574998b9/components/CameraPreview/src/CameraPreview.cs or https://github.com/hjam40/Camera.MAUI/tree/master/Camera.MAUI/Platforms/Windows for Windows until the WinUI team provides a control for Windows? I've been tinkering with various CameraView implementations on Windows with MAUI for some time, and I'd love to implement a temporary working CameraView for Windows (once you merge the Android and IOS implementations, so that I know the final version of the "interface" I need to provide). It can always be swapped later once the WinUI control exists. [https://github.com/microsoft/microsoft-ui-xaml/issues/4710](The issue) you mentioned, which this problem is following, is almost 3 years old, so the chance of an "official" control being implemented soon is like zero. If by some miracle the WinUI team actually implements this control, you can literally click delete on the files I'd commit and use the WinUI thing. I get your point, that MAUI should always use the maximum amount of native controls, but why not have a working "less clean" solution until a native control exists? I don't have the skills and knowledge to implement this for Android or IOS, but I'd love to implement it for Windows if you let me |
|
Hello all. I'm trying to find out if this is still being worked on. I have a Xamarin.Forms app that utilizes the XTC CameraView. It's a huge part of our app. XTC MauiCompat CameraView for iOS does not work and I was hoping that I would find that view here as I am in the process of converting the app to .NET MAUI. With the looming May 1st end of support deadline for Xamarin.Forms approaching fast, I would like to humbly ask if the CameraView will available in the near future? I read above that @Dresel said the iOS is pretty much ready to go. I see a lot of the latest dialogue is around the Windows version of the view. Is it possible to release the iOS and Android versions first without the Windows portion? Thanks. |
As discussed in Discord, this is the draft PR of my contribution for the iOS part for the camera view proposal, mostly as starting point for discussion / feedback.
It is based on the original branch / PR pj/cameraView-initial-work. These are the things I have done:
The following things are still missing (might get it done until end of this week):