fix(ios) fix not using the loudspeaker by default
Fixes: https://github.com/jitsi/jitsi-meet/issues/11563
This commit is contained in:
parent
f87ce0defe
commit
b5f3cd14c2
|
@ -248,6 +248,8 @@ RCT_EXPORT_METHOD(updateDeviceList) {
|
||||||
- (void)audioSessionDidChangeRoute:(RTCAudioSession *)session
|
- (void)audioSessionDidChangeRoute:(RTCAudioSession *)session
|
||||||
reason:(AVAudioSessionRouteChangeReason)reason
|
reason:(AVAudioSessionRouteChangeReason)reason
|
||||||
previousRoute:(AVAudioSessionRouteDescription *)previousRoute {
|
previousRoute:(AVAudioSessionRouteDescription *)previousRoute {
|
||||||
|
DDLogInfo(@"[AudioMode] Route changed, reason: %lu", (unsigned long)reason);
|
||||||
|
|
||||||
// Update JS about the changes.
|
// Update JS about the changes.
|
||||||
[self notifyDevicesChanged];
|
[self notifyDevicesChanged];
|
||||||
|
|
||||||
|
@ -259,16 +261,12 @@ RCT_EXPORT_METHOD(updateDeviceList) {
|
||||||
self->forceSpeaker = NO;
|
self->forceSpeaker = NO;
|
||||||
self->forceEarpiece = NO;
|
self->forceEarpiece = NO;
|
||||||
break;
|
break;
|
||||||
case AVAudioSessionRouteChangeReasonCategoryChange: {
|
case AVAudioSessionRouteChangeReasonCategoryChange:
|
||||||
// The category has changed. Check if it's the one we want and adjust as
|
// The category has changed, re-apply our config.
|
||||||
// needed.
|
// NB: It's tempting to doa category check here and skip the processing,
|
||||||
RTCAudioSessionConfiguration *currentConfig = [self configForMode:self->activeMode];
|
// but that won't work. If the config changes but the category remains
|
||||||
if ([session.category isEqualToString:currentConfig.category]) {
|
// the same we'll still find ourselves here.
|
||||||
// We are in the desired category, nothing to do here.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue