flutter-incall-manager
flutter-incall-manager copied to clipboard
setForceSpeakerphoneOn not work
setForceSpeakerphoneOn(flag: ?boolean) this method is not working on iOS
Same for me.
await incall.start(media: MediaType.AUDIO, auto: true, ringback: '');
await incall.setForceSpeakerphoneOn(flag: ForceSpeakerType.FORCE_ON);
Audio comes out of speaker on android, but quietly from earpiece on iOS. When I toggle on iOS:
await incall.setForceSpeakerphoneOn(flag: ForceSpeakerType.FORCE_ON);
// or
await incall.setForceSpeakerphoneOn(flag: ForceSpeakerType.FORCE_OFF);
I get messages in the logs:
FlutterInCallManager.AudioRouteChange.Reason: Override
FlutterInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: End
FlutterInCallManager.AudioRouteChange.SilenceSecondaryAudioHint: Unknow Value
FlutterInCallManager.AudioRouteChange.Reason: CategoryChange. category=AVAudioSessionCategoryPlayAndRecord mode=AVAudioSessionModeVoiceChat
FlutterInCallManager.updateAudioRoute(): [Enter] forceSpeakerOn flag=1 media=audio category=AVAudioSessionCategoryPlayAndRecord mode=AVAudioSessionModeVoiceChat
FlutterInCallManager.updateAudioRoute(): did NOT overrideOutputAudioPort()
FlutterInCallManager.updateAudioRoute() did NOT change audio mode
Over in @GioviQ 's fork there are some changes
flutter_incall_manager:
git:
url: git://github.com/GioviQ/flutter-incall-manager.git
You can see here they are using overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker
not overrideOutputAudioPort:AVAudioSessionPortBuiltInSpeaker
. Maybe that is the issue here with setSpeakerphoneOn()
...
@GioviQ have you been able to toggle speakerphone on iOS using your WebRTC experiment?
Over in @GioviQ 's fork there are some changes
flutter_incall_manager: git: url: git://github.com/GioviQ/flutter-incall-manager.git
You can see here they are using
overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker
notoverrideOutputAudioPort:AVAudioSessionPortBuiltInSpeaker
. Maybe that is the issue here withsetSpeakerphoneOn()
...@GioviQ have you been able to toggle speakerphone on iOS using your WebRTC experiment?
I tested only on Android.
I found on cloudwebrtc MediaStreamTrack
there is a function to enableSpeakerphone()
https://github.com/cloudwebrtc/flutter-webrtc/blob/master/lib/media_stream_track.dart#L58
Did this work for you?
I found on cloudwebrtc
MediaStreamTrack
there is a function toenableSpeakerphone()
Did this work for anyone? Are there permissions that need to be got?