getCurrentDevice method

Future<Map?> getCurrentDevice(
  1. int type
)

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.TXMediaDeviceTypeMicTRTCCloudDef.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});
}