blazor-camera-streamer icon indicating copy to clipboard operation
blazor-camera-streamer copied to clipboard

Get OverconstainedError in Azure

Open toddmueller opened this issue 2 years ago • 2 comments

When I deploy my app to an Azure Web App (Linux), I receive the following error when launching the camera:

Uncaught (in promise) OverconstrainedError Promise.then (async) start @ CameraStreamer.js:60 (anonymous) @ blazor.server.js:1 beginInvokeJSFromDotNet @ blazor.server.js:1 _invokeClientMethod @ blazor.server.js:1 _processIncomingData @ blazor.server.js:1 Ft.connection.onreceive @ blazor.server.js:1 i.onmessage @ blazor.server.js:1 InstrumentHooks.js:97

I have the framework set as .NET 7, and everything works well locally. Could this be an issue running Linux?

toddmueller avatar Nov 13 '23 19:11 toddmueller

I noticed in Azure deviceId from 'this._constraints' object is null, where locally, it's populated.

navigator.mediaDevices.getUserMedia(this._constraints).then(mediaStream => {

toddmueller avatar Nov 13 '23 19:11 toddmueller

Issue is now resolved.

By default, I have the camera off when the page is loaded. When a user clicks an icon, I load the camera and I need to load it up like this:

private async void Start()
{
    await JSRuntime.InvokeVoidAsync("toggleModal", "modal-id");

    isHidden = !isHidden;

    if (await CameraStreamerReference.GetCameraAccessAsync())
    {
        await CameraStreamerReference.ReloadAsync();

        await CameraStreamerReference.StartAsync();
    }
}

toddmueller avatar Nov 13 '23 21:11 toddmueller