Video not readable in custom call object, while video is read in prebuilt

Options

Hi,

We had a participant who used to be able to use video camera and microphone on daily, but somehow stopped being able to do so.

In the participant is 's console, we had a following error message. However, we didn't have this issue in daily prebuilt when the participant and we tested right with daily prebuilt after seeing the error so we are wondering why camera and mic was not readable.

Devices Error (Cam And Mic In Use): NotReadableError: Device in use

Also, this could be related to be the issue I reported in the recent post.

Answers

  • mark_at_daily
    mark_at_daily Community Manager, Dailynista admin
    Options

    Hi @TomohiroMaeda,

    The error you've seen usually happens on Windows and it's a sign the device(s) in question is in use by another application. To troubleshoot this, you can close out any other applications that are using the camera or mic. Alternatively, try switching to a new device to see if access resumes.

    If this is the case, then the best line of defense is handling this error and instructions to the user about how to recover from the issue. You can see how we handle this on Daily Prebuilt by:

    • Open an app that uses the camera and ensure that the camera is turned on
    • Open Daily Prebuilt and select the same camera
    • See the recovery UI

    Also, if you can share a session ID where this is happening, we can help take a look.

  • TomohiroMaeda
    Options

    @mark_at_daily

    Thanks. Here is the session ID with the problem.

    dec7a16c-6c4b-48d3-9b07-f1b158630a1d

    Also, here is the session ID where we tested with prebuilt UI

    70592d65-23aa-4557-9dcd-7fa4eb05e786
    (here, we still have "Devices Error (Cam And Mic In Use): NotReadableError: Device in use)" message, but prebult seemed to try to connect to the camera multiple times and it could read camera at some point.

    We tested on prebuilt UI and the camera was working. Then we closed the prebuilt UI tab and tested with custom UI right after, and camera was no longer working. Since it works for most of the participants, I have little clue why this is happening.

    Thanks!

    Tomo

  • mark_at_daily
    mark_at_daily Community Manager, Dailynista admin
    Options

    A NotReadableError happens on Windows computers when a device is already in use by another program. The way to resolve this error is:

    • Turn off the other program using the device
    • Select a different device

    From the logs, I can see that in the Prebuilt session, the user selected a different device after the NotReadableError occurred: https://share.cleanshot.com/L7hjXVQn

    In the non-Prebuilt session, the user never selected another device: https://share.cleanshot.com/9wGpdXrD

    Also, once the error has been resolved through one of the two measures above, the user either needs to reload the page or your application needs to attempt to setLocalVideo (or Audio), which will result in attempting to getUserMedia once again. In Daily Prebuilt, when a device error occurs, Daily Prebuilt attempts to enable the video (or audio) every two seconds, so that once the error condition is resolved, the device is used right away and the user doesn't have to reload the page.

    Hope this helps to explain things and gives you ideas of how to handle this in your application.

  • TomohiroMaeda
    Options

    @mark_at_daily

    Thanks! This is super helpful.

    In the test session, we made sure that the participant did not have other program using the camera. Is it possible to have this error when there is no other program using the device? (I noticed that in prebuilt, some cameras are shown as used by other program, but reloading multiple times solves this issue.)

    I think selecting a different device could solve this issue. However, can we still select another "device" when user has only single device for video?

    Thanks,

    Tomo

  • mark_at_daily
    mark_at_daily Community Manager, Dailynista admin
    edited December 2023
    Options

    Glad to hear this is helpful!

    Is it possible to have this error when there is no other program using the device?

    If the error message includes NotReadableError: Device in use then I would say no. This error means that another program is using the device. Unfortunately, this is a limitation on Windows.

    I think selecting a different device could solve this issue. However, can we still select another "device" when user has only single device for video?

    No, when a single device is available, the other program using the device must be closed or the device use must be turned off.

    In Daily Prebuilt, we use this language in an error modal to help a user figure out what to do:

    We cannot access your camera. Close any apps (like Zoom or Teams) that might be using your camera, then refresh the page.