Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Bug in code example on https://webrtc.org/getting-started/media-devices #253

Open
eyeinsky opened this issue Mar 30, 2020 · 0 comments
Open

Comments

@eyeinsky
Copy link

I couldn't find the code for the page https://webrtc.org/getting-started/media-devices in this repo, but in the code block for "Listening for devices changes" instead of the following:

// Listen for changes to media devices and update the list accordingly
navigator.mediaDevices.addEventListener('devicechange', event => {
    const newCameraList = getConnectedDevices('video');
    updateCameraList(newCameraList);
});

it should be:

// Listen for changes to media devices and update the list accordingly
navigator.mediaDevices.addEventListener('devicechange', async event => {
    const newCameraList = await getConnectedDevices('videoinput');
    updateCameraList(newCameraList);
});

(Added async and await, and replaced 'video' with 'videoinput'.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant