getCurrentDevice method
Get the currently used device (Support for macOS, Windows and web platforms)
Parameters:
type
Device type, which specifies the type of devices to be obtained. For more information, please see the definition of TXMediaDeviceType
. type
can only be TRTCCloudDef.TXMediaDeviceTypeMic、TRTCCloudDef.TXMediaDeviceTypeSpeaker, or TRTCCloudDef.TXMediaDeviceTypeCamera.
deviceId
Device ID obtained from getDevicesList
Returned value:
ITRTCDeviceInfo
device information, from which the device ID and device name can be obtained
Implementation
Future<Map?> getCurrentDevice(int type) {
return _channel.invokeMethod('getCurrentDevice', {"type": type});
}