Web

更新时间:
复制 MD 格式

RTC SDK allows you to detect and manage devices. You can check whether hardware devices work as expected before you join a channel. This topic describes how to detect and manage devices.

Overview

RTC SDK allows you to call internal methods to detect and manage devices. For example, you can query the information about devices, detect whether the camera works as expected, detect whether the audio device can record and play audio files, switch between front and rear cameras, or change audio devices (microphone and speaker).

Implementation methods

The following methods can be used to detect and manage devices. For more information, see AliRtcEngine class.

getDevices: obtains device information. The information about the camera and audio device is returned. If you fail to obtain device information after an external device is unplugged and plugged in again, try to restart the computer.

aliWebrtc.getDevices().then((re)=>{
}).catch((error)=>{ 
  console.log(error.message)
});