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

Return:

ITRTCDeviceInfo device information, from which the device ID and device name can be obtained

Implementation

Future<Map?> getCurrentDevice(int type
    ) async {
  var result = await _channel.invokeMapMethod('getCurrentDevice', {
    "type": type
  });
  return V2TXLiveFlutterResult.mapValue(result);
}