afriscic / BarcodeScanning.Native.Maui

Barcode scanning library for .NET MAUI
https://www.nuget.org/packages/BarcodeScanning.Native.Maui
MIT License
162 stars 31 forks source link

Video is frozen when attempt to call page a second time #5

Closed be-swarm closed 9 months ago

be-swarm commented 11 months ago

Step to reproduce: Create a page with your control. register it in di builder.Services.AddSingleton();

Navigate to your page. All is ok. Navigate back and navigate to your page a second time. Video is frozen.

Workaround found: Inject page with transient scope builder.Services.AddTransient();

afriscic commented 10 months ago

Try to add it in DI as transient and/or override OnDisappearing and set CameraEnabled to false to close the camre before you move out of the page, and then set CameraEnabled to true in OnAppearing override to enable the camera again.