Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.
This repository was 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

@eyeinsky

Description

@eyeinsky

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'.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions