getCurrentDevice method
- int type
获取当前正在使用的设备(仅适用于macOS、Windows与web)
参数:
type 设备类型,指定要获取的设备类型。更多信息,请参见 TXMediaDeviceType 的定义。type 只能是 TRTCCloudDef.TXMediaDeviceTypeMic,TRTCCloudDef.TXMediaDeviceTypeSpeaker 或 TRTCCloudDef.TXMediaDeviceTypeCamera。
deviceId 从 TXDeviceManager.getDevicesList 获取的设备ID
返回值:
ITRTCDeviceInfo 设备信息,可以从中获取设备ID和设备名称
Implementation
Future<Map?> getCurrentDevice(int type) {
return _channel.invokeMethod('getCurrentDevice', {"type": type});
}