Skip to content

Missing StartCameraAsync and StopCameraAsync #223

@Quietscheente

Description

@Quietscheente

Upgrading my app from Version 0.16.9.

As I have a ViewModel first approach that creates and destroys its Views on the fly I had a

private void StartCamera()
{
    if (!camerasLoaded)
        return;

    if (cameraView.Cameras.Count > 0)
    {            
        MainThread.BeginInvokeOnMainThread(async () =>
        {
            cameraView.Camera = cameraView.Cameras.First();

            await Task.Delay(500);
            await cameraView.StartCameraAsync();
            cameraView.BarCodeDetectionEnabled = true;
        });
    }
}

private void StopCamera()
{        
    if (cameraView.Camera is not null)
    {            
        MainThread.BeginInvokeOnMainThread(async () =>
        {
            await cameraView.StopCameraAsync();
        });
    }
}

so that I can reuse the camera (even on different views).

My current problem is that the camera works for the first time the view is created but after changing the view it is only black.
Is there a way to get this working again?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions