[Proposal] CameraView minimal port
See original GitHub issue[CameraView minimal port]
- Proposed
- Prototype: Not Started
- Implementation: Not Started
- iOS Support
- Android Support
- macOS Support
- Windows Support
- Unit Tests: Not Started
- Sample: Not Started
- Documentation: Not Started
Link to Discussion
Summary
Today on XCT we have a very complete CameraView
implementation but with a lot of bugs and a complex codebase to maintain. In the table below you can see all features implemented by each platform.
Android | iOS | Windows | |
---|---|---|---|
Preview | ✅ | ✅ | ✅ |
Preview Aspect | ✅ | 🚫 | 🚫 |
Mirror preview | ✅ | 🚫 | 🚫 |
Zoom | ✅ | ✅ | ✅ |
Take photo | ✅ | ✅ | ✅ |
Flash | ✅ | ✅ | ✅ |
Take video | ✅ | ✅ | ✅ |
Record audio | ✅ | ✅ | ✅ |
Video stabilization | ✅ | ✅ | ✅ |
My plan, described in discussion #206, is to drop some features for the v1.0 of this lib. and use CameraX
implementation for Android. You can see in the table below what features we will have for v1.0.
Android | iOS | Windows | |
---|---|---|---|
Preview | ✅ | ✅ | ✅ |
Take photo | ✅ | ✅ | ✅ |
Flash | ✅ | ✅ | ✅ |
After this first implementation, we can add the missing features to all platforms.
Motivation
The motivation for this plan was the fact that CameraView
lacks in quality right now and this’s our chance to fix it and provide a more reliable Camera control for our community.
Detailed Design
CameraView.shared.cs
public class CameraView : View
{
public static readonly BindableProperty IsCameraViewBusyProperty;
public static readonly BindableProperty IsAvailableProperty;
public static readonly BindableProperty FlashModeProperty;
// Use WeakEventManager
public event EventHandler<bool>? OnAvailable;
public event EventHandler<MediaCapturedEventArgs>? MediaCaptured;
public event EventHandler<string>? MediaCaptureFailed;
public bool IsCameraViewBusy { get; }
public bool IsAvailable { get; }
public CameraOptions CameraOptions { get; set; }
public void Shutter();
}
Usage Syntax
XAML Usage
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
x:Class="MyLittleApp.MainPage">
<StackLayout>
<xct:CameraView
x:Name="cameraView"
FlashMode="On"
MediaCaptured="CameraView_MediaCaptured"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand" />
</StackLayout>
</ContentPage>
C# Usage
class MyPage : ContentPage
{
public MyPage()
{
Content = new CameraView
{
FlashMode = CameraFlashMode.Off,
}.FillAndExpand()
.Invoke(cameraView => cameraView.MediaCaptured += HandleMediaCaptured);
}
void HandleMediaCaptured(object? sender, MediaCapturedEventArgs e)
{
//...
}
}
Drawbacks
We will (probably*) break our users on v1.0 since the API will be missing a lot of features.
- there’s a chance that we can implement all features for v1.0 if we have a lot of community help.
Alternatives
- Follow the #106 proposal and just port the XCT code to here, but with that, we will bring all issues (if we don’t solve them during the port, what I believe it’s very hard to do)
Unresolved Questions
Issue Analytics
- State:
- Created 2 years ago
- Reactions:17
- Comments:44 (19 by maintainers)
Top Results From Across the Web
city of duluth request for proposal for port security ...
The project should include at a minimum: Cameras that capture and transmit full motion video of at least 15 frames/ second. The camera(s)...
Read more >REQUEST FOR PROPOSAL FOR - Port Hueneme
The Scope of Services described herein is the minimum necessary to meet the City's objectives. The contractor is expected to expand on the...
Read more >A novel approach to port noise characterization using an ...
The main aim of this study is to identify key points in the application of an acoustic camera to the characterization of port...
Read more >Port Forwarding for your Security DVR and NVR
The default IP address for DVRs and NVRs purchased from CCTV Camera World is 192.168.1.108. Ports that need to be port forwarded: check...
Read more >Ports used by the system - Milestone Documentation
Provides video from a monitor. It appears and acts in the same way as a camera on the recording server. You can change...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, any updates when Camera View will be released?
Hi,
I have implemented a CameraView for all platforms with Zxing codebar detecting integrated if you wanna try it Camera.MAUI. If you are interested I could integrate it here.