Skip to content

Commit 2f49396

Browse files
committed
Version 1.0.18
Updated default user media constraints to be more in line with the standard (no longer using "mandatory" and "minWidth" / "minHeight" properties). Updated constraints demo.
1 parent ae68973 commit 2f49396

File tree

5 files changed

+15
-20
lines changed

5 files changed

+15
-20
lines changed

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# Build Script for WebcamJS
44
# Install uglifyjs first: sudo npm install uglify-js -g
55

6-
uglifyjs webcam.js -o webcam.min.js --mangle --reserved "Webcam" --preamble "// WebcamJS v1.0.17 - http://github.com/jhuckaby/webcamjs - MIT Licensed"
6+
uglifyjs webcam.js -o webcam.min.js --mangle --reserved "Webcam" --preamble "// WebcamJS v1.0.18 - http://github.com/jhuckaby/webcamjs - MIT Licensed"

demos/constraints.html

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
h2, h3 { margin-top:0; }
1010
form { margin-top: 15px; }
1111
form > input { margin-right: 15px; }
12+
#my_camera { background: #ccc; }
1213
#results { float:right; margin:20px; padding:20px; border:1px solid; background:#ccc; }
1314
</style>
1415
</head>
@@ -27,18 +28,14 @@ <h3>Demonstrates using the HTML5 user media constraints object</h3>
2728
<script language="JavaScript">
2829
Webcam.set({
2930
width: 320,
30-
height: 240,
31+
height: 180,
3132
image_format: 'jpeg',
3233
jpeg_quality: 90,
3334
constraints: {
34-
mandatory: {
35-
minWidth: 320,
36-
minHeight: 240
37-
// minFrameRate: 30
38-
},
39-
optional: [
40-
{ minFrameRate: 60 }
41-
]
35+
width: 320, // { exact: 320 },
36+
height: 180, // { exact: 180 },
37+
facingMode: 'user',
38+
frameRate: 30
4239
}
4340
});
4441
Webcam.attach( '#my_camera' );

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webcamjs",
3-
"version": "1.0.17",
3+
"version": "1.0.18",
44
"description": "HTML5 Webcam Image Capture Library with Flash Fallback",
55
"author": "Joseph Huckaby <jhuckaby@gmail.com>",
66
"homepage": "https://github.com/jhuckaby/webcamjs",

webcam.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// WebcamJS v1.0.16
1+
// WebcamJS v1.0.18
22
// Webcam library for capturing JPEG/PNG images in JavaScript
33
// Attempts getUserMedia, falls back to Flash
44
// Author: Joseph Huckaby: http://github.com/jhuckaby
55
// Based on JPEGCam: http://code.google.com/p/jpegcam/
6-
// Copyright (c) 2012 - 2016 Joseph Huckaby
6+
// Copyright (c) 2012 - 2017 Joseph Huckaby
77
// Licensed under the MIT License
88

99
(function(window) {
@@ -34,7 +34,7 @@ FlashError.prototype = new IntermediateInheritor();
3434
WebcamError.prototype = new IntermediateInheritor();
3535

3636
var Webcam = {
37-
version: '1.0.17',
37+
version: '1.0.18',
3838

3939
// globals
4040
protocol: location.protocol.match(/https/i) ? 'https' : 'http',
@@ -174,10 +174,8 @@ var Webcam = {
174174
this.mediaDevices.getUserMedia({
175175
"audio": false,
176176
"video": this.params.constraints || {
177-
mandatory: {
178-
minWidth: this.params.dest_width,
179-
minHeight: this.params.dest_height
180-
}
177+
width: this.params.dest_width,
178+
height: this.params.dest_height
181179
}
182180
})
183181
.then( function(stream) {

webcam.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)