Skip to content

Commit

Permalink
Chrome can use the new constraints object/spec since 59 (june 2017)
Browse files Browse the repository at this point in the history
  • Loading branch information
octavn committed Oct 30, 2018
1 parent 64fd7c1 commit 55a45d2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@

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

var constraints = {audio: true,video: { width: { min: 320, ideal: 320, max: 640 }, height: { min: 240, ideal: 240, max: 480 }}}; //Firefox

if(getBrowser() == "Chrome"){
var constraints = {"audio": true, "video": { "mandatory": { "minWidth": 320, "maxWidth": 640, "minHeight": 240,"maxHeight": 480 }, "optional": [] } };//Chrome
}else if(getBrowser() == "Firefox"){
var constraints = {audio: true,video: { width: { min: 320, ideal: 320, max: 640 }, height: { min: 240, ideal: 240, max: 480 }}}; //Firefox
}

var recBtn = document.querySelector('button#rec');
var pauseResBtn = document.querySelector('button#pauseRes');
Expand Down

0 comments on commit 55a45d2

Please sign in to comment.