<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>174833</bug_id>
          
          <creation_ts>2017-07-25 13:47:21 -0700</creation_ts>
          <short_desc>mediaDevices.enumerateDevices() is missing audioinput devices on iOS</short_desc>
          <delta_ts>2020-07-24 05:35:31 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Media</component>
          <version>Other</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 11</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>https://s3.amazonaws.com/safari-devices-testing/index.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>lepinski</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>daniel</cc>
    
    <cc>ddkilzer</cc>
    
    <cc>eric.carlson</cc>
    
    <cc>jond</cc>
    
    <cc>jonlee</cc>
    
    <cc>lepinski</cc>
    
    <cc>luke.mizuhashi</cc>
    
    <cc>szmydadam</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1332070</commentid>
    <comment_count>0</comment_count>
    <who name="">lepinski</who>
    <bug_when>2017-07-25 13:47:21 -0700</bug_when>
    <thetext>In the most recent iOS 11 build (15A5327g), calling mediaDevices.enumerateDevices() in Safari returns only &quot;iPhone Microphone&quot; as an audioinput device, despite other input devices being present.

To reproduce:
1. Connect an external audio input to an iOS 11 device
2. In Safari, call mediaDevices.getUserMedia() to get microphone permission
3. Call mediaDevices.enumerateDevices()
4. Returned devices will only include the iPhone Microphone audioinput device, and won&apos;t include the external input device

In the latest Safari Technology Preview for macOS this external device is returned by enumerateDevices as expected.

Tested with: iPhone SE running iOS 11 (15A5327g), external device: Apogee Duet https://www.apple.com/shop/product/HC173ZM/B/apogee-duet-usb-audio-interface-for-ipad-iphone-and-mac</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1334896</commentid>
    <comment_count>1</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2017-08-03 12:58:52 -0700</bug_when>
    <thetext>Is the external device listed after a call to getUserMedia?

enumerateDevices only returns the default devices until the user grants device access with getUserMedia (https://webkit.org/blog/7763/a-closer-look-into-webrtc/).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1334902</commentid>
    <comment_count>2</comment_count>
    <who name="">lepinski</who>
    <bug_when>2017-08-03 13:06:56 -0700</bug_when>
    <thetext>The enumerateDevices call follows getUserMedia &amp; mic approval.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1343717</commentid>
    <comment_count>3</comment_count>
    <who name="">lepinski</who>
    <bug_when>2017-08-30 14:52:01 -0700</bug_when>
    <thetext>I&apos;ve got a URL that is useful for testing this: https://s3.amazonaws.com/safari-devices-testing/index.html

Testing with Safari on the latest iOS 11 beta (15A5368a) with an external microphone connected:

2017-08-30T21:46:06.178Z [init] starting up
2017-08-30T21:46:06.179Z [init] getting media permission...
2017-08-30T21:46:06.179Z [init] Enumerate devices
2017-08-30T21:46:09.686Z [init] got media permission; eunmerating devices
2017-08-30T21:46:10.143Z [enumerateDevices] entire source list follows: 
2017-08-30T21:46:10.144Z kind: audioinput, label=iPhone Microphone, deviceId=23C467A56D616E048AB5E367AD0586A75AD1C22A
2017-08-30T21:46:10.146Z kind: videoinput, label=Back Camera, deviceId=247A083135FAC748D0E80E7EDCA6DB84C8629BF8
2017-08-30T21:46:10.146Z kind: videoinput, label=Front Camera, deviceId=28003D98E6289A035C4F5863257634BAA8B61E78</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1443531</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-07-19 15:07:02 -0700</bug_when>
    <thetext>&lt;rdar://problem/42402143&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1454061</commentid>
    <comment_count>5</comment_count>
    <who name="Luke Mizuhashi">luke.mizuhashi</who>
    <bug_when>2018-08-27 13:39:01 -0700</bug_when>
    <thetext>I&apos;m having a similar issue:

I&apos;m writing an app that allows people with disabilities to search for places and services that are accessible to their particular requirements (vis. search for hotels that work with your accessibility device, etc.)

So, we will have a lot of end users who have computers with cameras attached via USB, more than two cameras, perhaps zero, etc.

And yet, our app needs a button to cycle through media streams. So, hard-coding around the `navigator.mediaDevices.getUserMedia({ video: { facingMode: &apos;user&apos; }})` pattern won&apos;t be ideal.

We would like to use something like `navigator.mediaDevices.enumerateDevices().then(deviceInfoList =&gt; cache = deviceInfoList);`

followed by:

`someElement.on(&apos;click&apos;, () =&gt; { navigator.mediaDevices.getUserMedia({ video: { deviceId: cache.nextId() }}) }`, but because the device ID&apos;s reported by Safari change unpredictably inside a single session we are unable to use device ID reliably.

We&apos;ve tested on iOS 11.4 (15F79) with Safari 5.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1628741</commentid>
    <comment_count>6</comment_count>
    <who name="Daniel">daniel</who>
    <bug_when>2020-03-11 10:44:25 -0700</bug_when>
    <thetext>I&apos;m experiencing the same issue as above (tested on iOS 13.3.1, iPhone 7 &amp; iPhone 8, with both a wired headset and AirPods). Using https://s3.amazonaws.com/safari-devices-testing/index.html only &apos;iPhone Microphone&apos; is listed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1628748</commentid>
    <comment_count>7</comment_count>
    <who name="Eric Carlson">eric.carlson</who>
    <bug_when>2020-03-11 10:57:19 -0700</bug_when>
    <thetext>(In reply to Daniel from comment #6)
&gt; I&apos;m experiencing the same issue as above (tested on iOS 13.3.1, iPhone 7 &amp;
&gt; iPhone 8, with both a wired headset and AirPods). Using
&gt; https://s3.amazonaws.com/safari-devices-testing/index.html only &apos;iPhone
&gt; Microphone&apos; is listed.

Are the other devices listed after a call to getUserMedia?

enumerateDevices only returns the default devices until the user grants device access with getUserMedia to lessen the use of this API for fingerprinting (https://webkit.org/blog/7763/a-closer-look-into-webrtc/).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1628759</commentid>
    <comment_count>8</comment_count>
    <who name="Daniel">daniel</who>
    <bug_when>2020-03-11 11:10:38 -0700</bug_when>
    <thetext>(In reply to Eric Carlson from comment #7)
&gt; (In reply to Daniel from comment #6)
&gt; &gt; I&apos;m experiencing the same issue as above (tested on iOS 13.3.1, iPhone 7 &amp;
&gt; &gt; iPhone 8, with both a wired headset and AirPods). Using
&gt; &gt; https://s3.amazonaws.com/safari-devices-testing/index.html only &apos;iPhone
&gt; &gt; Microphone&apos; is listed.
&gt; 
&gt; Are the other devices listed after a call to getUserMedia?
&gt; 
&gt; enumerateDevices only returns the default devices until the user grants
&gt; device access with getUserMedia to lessen the use of this API for
&gt; fingerprinting (https://webkit.org/blog/7763/a-closer-look-into-webrtc/).

List before getUserMedia():
[
 {deviceId: &quot;&quot;, kind: &quot;audioinput&quot;, label: &quot;&quot;, groupId: &quot;&quot;, toJSON: function},
 {deviceId: &quot;&quot;, kind: &quot;videoinput&quot;, label: &quot;&quot;, groupId: &quot;&quot;, toJSON: function}
]

list after getUserMedia():
[
 {deviceId: &quot;AFBAD73FC671AF21C6FAABF0F07FD446A1C36AED&quot;, kind: &quot;audioinput&quot;, label: &quot;iPhone Microphone&quot;, groupId: &quot;&quot;, toJSON: function},
 {deviceId: &quot;7049D645D2B1E988105392107FFEA5F5D9BACECD&quot;, kind: &quot;videoinput&quot;, label: &quot;Front Camera&quot;, groupId: &quot;&quot;, toJSON: function},
 {deviceId: &quot;513F58EDA3D167900B14BFE113AAE7E1B072521C&quot;, kind: &quot;videoinput&quot;, label: &quot;Back Camera&quot;, groupId: &quot;&quot;, toJSON: function}
]

The list remains the same with wired headset/airpods connected.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>