enableSpeakerphone method

Future<int?> enableSpeakerphone(
  1. bool enable
)

@detail api @author luomingkang @brief Turns on/off the speaker after joining a game room. @param enable Whether to turn on the speaker:
- true: Turns on the speaker and subscribes to audio streams of all remote users. - false: Default setting. Turns off the speaker and unsubscribes audio streams from all remote users. @return - 0: Success. - -3: Failure. Not joined a room.

Implementation

Future<int?> enableSpeakerphone(bool enable) async {
  $a() => ($instance as $p_a.IGameRoom).enableSpeakerphone(enable);
  $i() => ($instance as $p_i.ByteRTCGameRoom).enableSpeakerphone(enable);

  if (Platform.isAndroid) {
    return $a();
  } else if (Platform.isIOS) {
    return $i();
  } else {
    throw UnsupportedError(
        'Not Support Platform ${Platform.operatingSystem}');
  }
}