title: How to force a 16:9 ratio with getUserMedia on all devices?
body: <p>I need to use <code>getUserMedia</code> while the video is set to record in <strong>16:9 resolution</strong>.</p>
  
  <p>My code works on most desktops and on Android 7 and above:</p>
  
  <pre><code>navigator.getUserMedia( {
     audio: true,
     video: {
        mandatory: {
            minWidth: 380,
            minHeight: 214,
            maxWidth: 380,
            maxHeight: 214
        }
     }
  })
  </code></pre>
  
  <p>But on Android 6 and below, and on some desktops too (can't figure out exactly which), <code>getUserMedia</code> breaks, and no image is available from the camera.</p>
  
  <p>This works on <strong>all devices</strong> and desktop, but with a default resolution ratio of 4:3, while I need 16:9:</p>
  
  <pre><code>navigator.getUserMedia( {
     audio: true,
     video: true
  })
  </code></pre>
  
  <p>I tried omitting the <code>mandatory</code>, no luck.</p>
  
  <p>To add to my confusion, iOS devices (11 beta) and Android require passing the <code>facingMode</code> argument:</p>
  
  <pre><code>video: { facingMode: 'user' }
  </code></pre>
  
  <p>So, it seems that passing the <code>width</code> and <code>height</code> arguments breaks <code>getUserMedia</code> on some desktops and devices like Android 5 and 6. </p>
  
  <p>Is there a way to force a 16:9 ratio on all devices? What is the correct and conventional method of capturing a video with specific dimensions?</p>