Suggestions

close search

Add Messaging, Voice, and Authentication to your apps with Vonage Communications APIs

Visit the Vonage API Developer Portal

VideoExpress.getDevices

This API is a wrapper around OT.getDevices. It returns a Promise<devices>.

The following gets an array of devices:

const devices = await VideoExpress.getDevices();

Methods

Name Description
(Promise<devices>) VideoExpress.getDevices ()

Returns an array of objects corresponding to available microphones and cameras. Each object has three properties: kind, deviceId, and label, each of which are strings.

The kind property is set to audioInput for audio input devices or videoInput for video input devices.

The deviceId property is a unique ID for the device. You can pass the deviceId in as the audioSource or videoSource property of the publisherOptions parameter room.join() method.

The label property identifies the device. The label property is set to an empty string if the user has not previously granted access to a camera and microphone.

Note: The browser may limit the number of returned audio and video input devices to one each before the user has granted accees to a camera or microphone.