openLocalMicrophone method

Future<TUIActionCallback> openLocalMicrophone()

Implementation

Future<TUIActionCallback> openLocalMicrophone() async {
  var microphone = await Permission.microphone.request();

  if (!microphone.isGranted) {
    LiveKitLogger.error('requestMicrophonePermissions:[onDenied]');
    return TUIActionCallback(code: TUIError.errPermissionDenied, message: "camera permission denied");
  }
  unMuteLocalAudio();
  var result = await liveService.openLocalMicrophone(TUIAudioQuality.audioProfileDefault);
  if (result.code == TUIError.success) {
    mediaState.isMicrophoneOpened.value = true;
  }
  return result;
}