browser-compat-data icon indicating copy to clipboard operation
browser-compat-data copied to clipboard

api.MediaDevices.enumerateDevices - doesnt return audio output device in ios safari

Open Ezhil-Git opened this issue 1 year ago • 1 comments

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

Ezhil-Git avatar May 22 '24 09:05 Ezhil-Git

This is also happening on desktop safari

juancholt avatar Aug 15 '24 14:08 juancholt

Same here

ornakash avatar Oct 28 '24 09:10 ornakash

I got the same problem

nguyenminhnh4t avatar Oct 28 '24 10:10 nguyenminhnh4t

I also have the same problem

maitogami123 avatar Oct 29 '24 03:10 maitogami123

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.

conradfr avatar Mar 01 '25 10:03 conradfr

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

brokeboiflex avatar Aug 06 '25 18:08 brokeboiflex