setCurrentDevice method
Setting the Device to Use (for Desktop OS)
- Parameters:
- deviceId(String):
- Device ID. You can get the ID of a device using the getDevicesList API.
- type(TXMediaDeviceType):
- Device type.
- deviceId(String):
Return Description:
0: Operation successful;- Negative number: Operation failed.
Implementation
int setCurrentDevice(TXMediaDeviceType type, String deviceId) {
if (_only_support_desktop) {
ffi.Pointer<ffi.Char> deviceIdPointer = deviceId.toNativeUtf8().cast<ffi.Char>();
int result = _deviceFFIBindings.set_current_device(_nativePointer, type.value(), deviceIdPointer);
calloc.free(deviceIdPointer);
return result;
} else {
debugPrint("device-manager-api not support");
return -1;
}
}