title: Android Mobile Browser - navigator.mediaDevices.enumerateDevices method returns audio input and output device values swapped
body: <p>I am using the navigator function - <code>navigator.mediaDevices.enumerateDevices()</code> to get the list of media devices, in my mobile browser application. I am using the below code:</p>
  
  <pre><code>navigator.mediaDevices.enumerateDevices().then(function(devices) {
   console.log("devices", devices);
  });
  </code></pre>
  
  <p>I am getting the audio input and audio output devices object values swapped as below:</p>
  
  <pre><code>[
    {
      "deviceId": "default",
      "kind": "audioinput",
      "label": "Default",
      "groupId": "41a111f571a1171ca91c5428d2ad8806a66bb6d7c5812f779161151a706641a1"
    },
    {
      "deviceId": "bbf2c347dbfc70b9e37b16be622c4973a74269c7f53d4162adab0c09614514d1",
      "kind": "audioinput",
      "label": "Speakerphone",
      "groupId": "e8dc20cc0a8dd33f65085c2f06bb8424105eb230c54237c343b8f8ff960559f3"
    },
    {
      "deviceId": "704cd1e8449390f5bb3fd1615a7637753f4ad019d4e6bb3f7c36690f58f2536d",
      "kind": "audioinput",
      "label": "Headset earpiece",
      "groupId": "1f2f370cbbe3f57fe3a8e901dc8f82c8d751f690520c261b293b1480e7959218"
    },
    {
      "deviceId": "38f008a97b8fd5ff8d367c336fcb7120fdc499375fb44459980d60395516b955",
      "kind": "videoinput",
      "label": "camera2 1, facing front",
      "groupId": "3b073bb17b0c56c5f8e6f143d6eeebcbfac5ec2ebc8ff2bc852f66745a63c591"
    },
    {
      "deviceId": "bbf2c347dbfc70b9e37b16be622c4973a74269c7f53d4162adab0c09614514d1",
      "kind": "videoinput",
      "label": "camera2 0, facing back",
      "groupId": "5a8b08633d9b089d234fc7bb0d67fae394e90a4f7948128562251d17408d99d4"
    },
    {
      "deviceId": "default",
      "kind": "audiooutput",
      "label": "Default",
      "groupId": "default"
    }
  ]
  </code></pre>
  
  <p>I have tried this in three other android mobile browsers and it's swapping the values in those devices also. In PC it's working correctly. Why it's swapping those values in mobile browsers?</p>
  
  <p>Also, I have checked this webpage to verify - <a href="https://webrtc.github.io/samples/src/content/devices/input-output/" rel="nofollow noreferrer">webrtc input-output devices</a>, here it's showing speakerphone in audio input devices list as you can see in the screenshot below.</p>
  
  <p><a href="https://i.stack.imgur.com/9TWVe.jpg?s=256" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9TWVe.jpg?s=256" alt="enter image description here"></a></p>