Skip to content

Commit

Permalink
Switched to 320x240 by default
Browse files Browse the repository at this point in the history
  • Loading branch information
octavn committed Oct 30, 2018
1 parent a609ded commit 97a243c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ strong {

video {
background: #222;
margin: 10px auto;
width: 640px;
height:480px;
margin: 10px auto;
width: 320px;
height:240px;
}

@media screen and (max-width: 650px) {
Expand All @@ -247,3 +247,4 @@ video {
font-size: 20px;
}
}

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div id="container">
<div style = "text-align:center;">
<h1>Media Recorder API Demo </h1>
<h2>Record a 640x480 video using the media recorder API implemented in Firefox and Chrome</h2>
<h2>Record a 320x240 video using the media recorder API implemented in Firefox and Chrome</h2>
<video controls autoplay></video><br>
<button id="rec" onclick="onBtnRecordClicked()">Record</button>
<button id="pauseRes" onclick="onPauseResumeClicked()" disabled>Pause</button>
Expand Down
4 changes: 2 additions & 2 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia


if(getBrowser() == "Chrome"){
var constraints = {"audio": true, "video": { "mandatory": { "minWidth": 640, "maxWidth": 640, "minHeight": 480,"maxHeight": 480 }, "optional": [] } };//Chrome did not support the new constraints spec until 59 for video and 60 for audio
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: 640, ideal: 640, max: 640 }, height: { min: 480, ideal: 480, max: 480 }}}; //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');
Expand Down

0 comments on commit 97a243c

Please sign in to comment.