MediaSFU Shared
    Preparing search index...

    Function listMediaDevices

    • Cameras and microphones available for a device picker.

      Uses the SDK's own getMediaDevicesList when the bag exposes it, so the result reflects the same mediaDevices instance the SDK captures with; otherwise falls back to navigator.mediaDevices.enumerateDevices().

      Labels are blank until the user has granted permission once — call this after the first successful capture if you need readable device names.

      Parameters

      Returns Promise<MediaDeviceList>

      const { cameras } = await listMediaDevices({ parameters });
      await runMediaControl({
      parameters,
      control: 'switchVideo',
      extra: { videoPreference: cameras[1].deviceId },
      });