enableSpeakerPhone method

void enableSpeakerPhone(
  1. bool enable
)

Implementation

void enableSpeakerPhone(bool enable) {
  if (kIsWeb) {
    _logger.d("Peer :: Speaker Enabled :: $enable");
    _localStream!.getAudioTracks().first.enableSpeakerphone(enable);
    return;
  }
  if (_localStream != null) {
    _localStream!.getAudioTracks()[0].enableSpeakerphone(enable);
    _logger.d("Peer :: Speaker Enabled :: $enable");
  } else {
    _logger.d("Peer :: No local stream :: Unable to toggle speaker mode");
  }
}