ConnectyCube / connectycube-flutter-call-kit

A Flutter plugin for displaying call screen when the app in the background or terminated.
https://developers.connectycube.com/flutter
Apache License 2.0
57 stars 80 forks source link

Speaker button is not clickable. #145

Closed cofirazak closed 7 months ago

cofirazak commented 7 months ago

First of all, thank you for this package! Great work! 🙏

My problem is the Speaker button – after accepting a call this button is activated by default, and i hear the audio from the speaker. But this button is not clickable – if i tap on it just nothing happens even in logs, so i can't turn the speaker off. By the way the Mute button works as expected.

Any ideas why could that happen, and how to fix this?

telegram-cloud-photo-size-2-5442821542812702454-y

TatankaConCube commented 7 months ago

the Flutter app has its own features for working with audio after establishing the audio session. if you use the flutter_webrtc for calls, you can try to configure the audio session using its tools. for it, you can call

        Helper.setAppleAudioConfiguration(AppleAudioConfiguration(
          appleAudioCategory: AppleAudioCategory.playAndRecord,
          appleAudioCategoryOptions:  {
            AppleAudioCategoryOption.allowBluetooth,
            AppleAudioCategoryOption.mixWithOthers,
          },
          appleAudioMode: AppleAudioMode.voiceChat //or AppleAudioMode.videoChat
        ));

but pay attention, if you select the AppleAudioMode.videoChat you can't switch between speaker and headphone, and if you select the AppleAudioMode.voiceChat the default output will be switched to the headphone and you will need to switch to the speaker manually.

try this code immediately after starting the call or after accepting the call.

cofirazak commented 7 months ago

@TatankaConCube Thank you! That helped me a lot 🎉