2

I'm trying to create a HTML5 video element that streams from the local camera with the exact size of 380 x 214 pixels. I found that the only way to do this is using mandatory with minWidth, minHeight etc.

So this code works great on chrome, but not on Firefox or Microsoft Edge.

    navigator.getUserMedia = navigator.getUserMedia ||
                             navigator.webkitGetUserMedia ||
                             navigator.mozGetUserMedia;

    navigator.getUserMedia(
    {
        audio: true,
        video: {
            mandatory: {
                minWidth: 380,
                minHeight: 214,
                maxWidth: 380,
                maxHeight: 214
            }
        }
    }, function (stream) {
       ....
    });

I've been attempting various properties to the video element, but none of them seem to change its default 4:3 aspect ratio on those browsers.

enter image description here

Any idea how can I resolve this ?

Koby Douek
  • 16,156
  • 19
  • 74
  • 103
  • Possible duplicate of [WebRTC firefox constraints](http://stackoverflow.com/questions/28282385/webrtc-firefox-constraints) – jib May 07 '17 at 19:23

0 Answers0