Open hankwu0315 opened 8 months ago
if you found any solution then let me know
any updates of this?
EDIT: update the package to 2.0.4+1 fixes this issue for me
any updates of this?
EDIT: update the package to 2.0.4+1 fixes this issue for me
That's good news! I'll try it
any updates of this?
EDIT: update the package to 2.0.4+1 fixes this issue for me
Unfortunately, still not working
I have found a solution to this, the problem is this package (or maybe the OS) is defaulting to the earpiece instead of the speakers (make sense), and using Helper.setSpeakerphoneOn(true);
or Helper.setSpeakerphoneOnButPreferBluetooth();
IS doing what it's supposed to, it's just that the OS and flutter_webrtc
are racing each other.
you'll have to either:
1- set a delay after starting a call to toggle the speakers.
await FlutterCallkitIncoming.startCall(_).then((_) async {
await Future<void>.delayed(const Duration(seconds: 3));
// I noticed that a 3-second delay works consistently, experiment with it.
await Helper.setSpeakerphoneOnButPreferBluetooth();
});
2- or, find a point where you're sure the OS has finished the process of starting the call, in my case using flutter_webrtc
with BigBlueButton backend, I can wait for a message that notifies me of my state during the call (ex: IN_ECHO_TEST
or IN_CONFERENCE
) and toggling the speakers afterwards.
TLDR: toggle the speakers a few moments after starting the call, 2 - 3 seconds should work.
I use flutter_webrtc to implement video calls When flutter_callkit_incoming is not used, the speaker works fine, I use the following method to switch headphones or speakers: Helper.setSpeakerphoneOn(true);
If I use flutter_callkit_incoming, I cannot use setSpeakerphoneOn to switch the audio output on android sometimes audio output is speaker, sometimes is earpiece on iOS
Flutter version 3.16.3 vs Dart version 3.2.3 flutter_callkit_incoming: ^2.0.3 flutter_webrtc: ^0.9.22