The audio/video input devices are identified by the device ID (
deviceId). Each device has a unique device ID which you can get by
getDevices. The device ID is randomly generated, and might change for the same device, so we recommend you call the
getDevices method every time before switching the device.
For the Agora Web SDK v2.4.1 or earlier
cameraIdparameters in the
createStreammethod to switch the microphone and camera.
For the Agora Web SDK v2.5.0 or later
switchDevicemethod after getting the device ID. This method does not work on Safari 11 and Firefox.
If you do not need to select the input devices, set
createStream to use the first input device by default.