switch audio device when switching to video

This commit is contained in:
Daniel Gultsch 2024-01-16 13:56:39 +01:00
parent ebb48e9320
commit 6ba9208eea
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2
2 changed files with 9 additions and 0 deletions

View file

@ -145,6 +145,13 @@ public class CallIntegration extends Connection {
}
}
public void setAudioDeviceWhenAvailable(final AudioDevice audioDevice) {
final var available = getAudioDevices();
if (available.contains(audioDevice)) {
this.setAudioDevice(audioDevice);
}
}
@RequiresApi(api = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
private Set<AudioDevice> getAudioDevicesUpsideDownCake() {
return ImmutableSet.copyOf(

View file

@ -2610,6 +2610,8 @@ public class JingleRtpConnection extends AbstractJingleConnection
private void modifyLocalContentMap(final RtpContentMap rtpContentMap) {
final RtpContentMap activeContents = rtpContentMap.activeContents();
setLocalContentMap(activeContents);
this.callIntegration.setAudioDeviceWhenAvailable(
CallIntegration.initialAudioDevice(activeContents.getMedia()));
updateEndUserState();
}