api.MediaDevices.enumerateDevices - doesnt return audio output device in ios safari
What type of issue is this?
Missing compatibility data
What information was incorrect, unhelpful, or incomplete?
Safari is not fully supporting the enumerateDevices, even after getUserMedia is allowed, audiooutput device is 0
What browsers does this problem apply to, if applicable?
Safari
What did you expect to see?
With headphones connected, i must be able to see external headphone and built in speaker listed
Did you test this? If so, how?
https://jsfiddle.net/px56shgz/
Can you link to any release notes, bugs, pull requests, or MDN pages related to this?
https://stackoverflow.com/questions/62827607/audio-output-device-array-is-of-length-0-on-safari
Do you have anything more you want to share?
No response
MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/enumerateDevices
MDN metadata
MDN page report details
- Query:
api.MediaDevices.enumerateDevices - Report started: 2024-05-22T08:43:44.872Z
This is also happening on desktop safari
Same here
I got the same problem
I also have the same problem
Still a thing.
The API itself is a bit stupid as you have to ask access to the microphone to be able to list and change output device, that can be confusing for the user.
Well, Firefox has "selectAudioOutput()" but it's experimental.
From my tests, the reason it happens is becouse the audio input and audio output are coupled together - you can reproduce it quite easily by connecting any bluetooth headphones and toggling between iphoneMic and headphones as an audio source.
TLDR: use audio input devices as audio output devices and modify the tracks as needed. I know it's bad dev experience, but there's nothing that can be done about apple's perpetual autism.
Edit: Bugzilla confirms the results of my tests https://bugs.webkit.org/show_bug.cgi?id=179415