setBluetoothMode method

Future<int?> setBluetoothMode(
  1. BluetoothMode mode
)

设置蓝牙模式, 仅 iOS 可用。

Implementation

Future<int?> setBluetoothMode(BluetoothMode mode) async {
  var $modeMap = {
    BluetoothMode.hfp: $i.ByteRTCBluetoothMode.hfp,
    BluetoothMode.a2dp: $i.ByteRTCBluetoothMode.a2dp,
    BluetoothMode.auto: $i.ByteRTCBluetoothMode.auto,
  };
  if (!($modeMap.containsKey(mode))) {
    throw Exception("setBluetoothMode not support:" + mode.toString());
  }
  if (Platform.isIOS) {
    return ($instance as $i.ByteRTCEngine).setBluetoothMode($modeMap[mode]!);
  } else {
    throw UnsupportedError(
      'Not Support Platform ${Platform.operatingSystem}',
    );
  }
}