setCurrentDevice method
设置当前要使用的设备(仅适用于macOS、Windows与web)
参数:
type 设备类型,指定要获取的设备类型。更多信息,请参见 TXMediaDeviceType 的定义。type 只能是 TRTCCloudDef.TXMediaDeviceTypeMic、TRTCCloudDef.TXMediaDeviceTypeSpeaker 或 TRTCCloudDef.TXMediaDeviceTypeCamera。
deviceId 从 TXDeviceManager.getDevicesList 获取的设备 ID
返回值:
0:成功;负数:失败
Implementation
Future<int?> setCurrentDevice(int type, String deviceId) {
return _channel
.invokeMethod('setCurrentDevice', {"type": type, "deviceId": deviceId});
}