Skip to content

Commit 8a93b24

Browse files
author
Chad Hart
committed
fixed gUM constraints syntax
1 parent 6f20923 commit 8a93b24

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

js/resolutionScan.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,16 @@ function gum(candidate, device) {
145145
var constraints = {
146146
audio: false,
147147
video: {
148-
mandatory: {
148+
/*mandatory: {
149149
sourceId: device.id,
150-
minWidth: candidate.width,
150+
minWidth: {candidate.width,
151151
minHeight: candidate.height,
152152
maxWidth: candidate.width,
153-
maxHeight: candidate.height
153+
maxHeight: candidate.height*/
154+
width: {exact: candidate.width}, //new syntax
155+
height: {exact: candidate.height} //new syntax
154156

155-
}
157+
// }
156158
}
157159
};
158160

@@ -166,7 +168,7 @@ function gum(candidate, device) {
166168
captureResults("fail: " + error.name);
167169
}
168170
});
169-
}, (stream ? 100 : 0)); //official examples had this at 200
171+
}, (stream ? 200 : 0)); //official examples had this at 200
170172

171173

172174
function gotStream(mediaStream) {
@@ -186,7 +188,7 @@ function gum(candidate, device) {
186188

187189
function displayVideoDimensions() {
188190
if (!video.videoWidth) {
189-
setTimeout(displayVideoDimensions, 100); //was 500
191+
setTimeout(displayVideoDimensions, 500); //was 500
190192
}
191193

192194
if (video.videoWidth * video.videoHeight > 0) {

0 commit comments

Comments
 (0)