1920345ecd
Speaker worked but the earpiece was silent, and call audio flickered on speaker then dropped. Causes: (1) the category set .defaultToSpeaker, so overrideOutputAudioPort(.none) fell back to the loudspeaker instead of the receiver; (2) setSpeaker re-ran setCategory+setActive on every toggle mid-call, tearing down the audio unit WebKit's WebRTC engine was using and silencing the earpiece route. Fix: drop .defaultToSpeaker (drive the port explicitly), make setSpeaker flip ONLY overrideOutputAudioPort, and observe routeChangeNotification to re-assert the chosen route when WebKit reconfigures the session at call start / device change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>