<?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>209739</bug_id>
          
          <creation_ts>2020-03-30 07:24:54 -0700</creation_ts>
          <short_desc>iOS 13.4 enumerateDevices() does not report the camera after the first call</short_desc>
          <delta_ts>2020-03-30 07:32: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>WebRTC</component>
          <version>Safari 13</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>iOS 13</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>209417</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="milen">milen.yordanov</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1635494</commentid>
    <comment_count>0</comment_count>
    <who name="milen">milen.yordanov</who>
    <bug_when>2020-03-30 07:24:54 -0700</bug_when>
    <thetext>Tested on iPhone 7, iOS 13.4

Open Mobile Safari and go to https://milen-yordanov.github.io/webrtc-ios13_4-enumerateDevices/

The first call to enumerateDevices() reports two devices: videoinput and audioinput.

The second call to enumerateDevices() reports two devices: audioinput and audioinput. There is no videoinput!

The code to reproduce it is as simple as:

await navigator.mediaDevices.enumerateDevices()
await navigator.mediaDevices.enumerateDevices()
 

See: https://raw.githubusercontent.com/milen-yordanov/webrtc-ios13_4-enumerateDevices/master/index.html

Older iOS 13.x and 12.x did not have this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1635495</commentid>
    <comment_count>1</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2020-03-30 07:26:41 -0700</bug_when>
    <thetext>This is a dupe of bug 209417 which is now fixed in WebKit ToT.

*** This bug has been marked as a duplicate of bug 209417 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1635498</commentid>
    <comment_count>2</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2020-03-30 07:32:31 -0700</bug_when>
    <thetext>There are a number of workarounds:
- On iOS, all devices running Safari should have a camera.
- Add a shim to enumerateDevices so as to buffer the result of enumerateDevices until capture is granted/devicechange event is fired.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>