For users who would prefer to use the handset earpiece in an audio-only WebRTC call, this isn't possible because mediaDevices.enumerateDevices() doesn't return any audio output options in iOS. Verified this is still the case in 11.3
<rdar://problem/39081303>
Created attachment 338212 [details] Sample HTML page showing how to get AudioContext to change Second for that. I notice that the AudioContext in Safari automatically switches to VideoConference mode, changing the sound quality out of the device speaker to voice optimized and randomly flipping any other media audio through the earpiece and back to the speaker. While I understand the change in AudioContext, I would at least like to be able to have ALL audio, both WebRTC remote streams and loaded media play through the same output and be able to keep it outputting to the same device. I've attached a test page which reproduces what I am saying. Start playing the video, then while it is playing, click the <Start gUM> button to see the change in audio context. This test doesn't show the change between earpiece and speaker, but I find when I attach a remote stream, it moves loaded media to the earpiece and the remote user's audio to the speaker. After I remove their stream, it stays in the earpiece until I pause and restart playback, then the local media starts playing through the speaker again.