Problem
When CameraView is displayed, the first frame from the camera preview can appear rotated or frozen until CameraX fully initializes. There is no public event or callback to reliably detect when the camera preview is actually ready to be shown to the user.
Current workaround
The only proxy signal available without forking the library is subscribing to PropertyChanged on CurrentZoomFactor — it changes from -1 to a positive value when CameraX reaches CameraState.Open and sets the zoom. Combined with a small delay (~150ms for TextureView rendering), this allows a reasonably timed overlay fade-out.
private void OnCameraReady(object? sender, PropertyChangedEventArgs e)
{
if (e.PropertyName != nameof(CameraView.CurrentZoomFactor))
return;
if (BarcodeReader.CurrentZoomFactor <= 0)
return;
BarcodeReader.PropertyChanged -= OnCameraReady;
// fade out overlay
}
This works but is fragile — it relies on an implementation detail that could change.
Proposal
Add a public event (e.g. CameraPreviewReady) that fires when the camera preview surface is fully initialized and rendering. This would allow apps to:
- Show a loading overlay and hide it at exactly the right moment
- Avoid the visible rotated/frozen first frame
- Remove fragile workarounds based on
Task.Delay or property change side effects
Environment
- BarcodeScanning.Native.Maui 3.0.0
- .NET MAUI 10
- Tested on Android (CameraX)
Problem
When
CameraViewis displayed, the first frame from the camera preview can appear rotated or frozen until CameraX fully initializes. There is no public event or callback to reliably detect when the camera preview is actually ready to be shown to the user.Current workaround
The only proxy signal available without forking the library is subscribing to
PropertyChangedonCurrentZoomFactor— it changes from-1to a positive value when CameraX reachesCameraState.Openand sets the zoom. Combined with a small delay (~150ms for TextureView rendering), this allows a reasonably timed overlay fade-out.This works but is fragile — it relies on an implementation detail that could change.
Proposal
Add a public event (e.g.
CameraPreviewReady) that fires when the camera preview surface is fully initialized and rendering. This would allow apps to:Task.Delayor property change side effectsEnvironment