flutter-incall-manager icon indicating copy to clipboard operation
flutter-incall-manager copied to clipboard

setForceSpeakerphoneOn not work

Open itzamdev opened this issue 5 years ago • 5 comments

setForceSpeakerphoneOn(flag: ?boolean) this method is not working on iOS

itzamdev avatar Nov 08 '19 20:11 itzamdev

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

CoreyCole avatar Jan 07 '20 23:01 CoreyCole

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?

CoreyCole avatar Jan 08 '20 00:01 CoreyCole

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?

I tested only on Android.

GioviQ avatar Jan 09 '20 07:01 GioviQ

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

CoreyCole avatar Jan 16 '20 19:01 CoreyCole

Did this work for you?

I found on cloudwebrtc MediaStreamTrack there is a function to enableSpeakerphone()

Did this work for anyone? Are there permissions that need to be got?

trulite avatar Jul 23 '20 20:07 trulite