-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathubiquity.js
68 lines (39 loc) · 938 Bytes
/
ubiquity.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
* Class and executable ubiquity
*
*/
"use strict";
var NodeWebcam = require( "./../index.js" );
var Async = require( "async" );
var CamTypes = {
linux: [
"FSWebcam"
],
darwin: [
"ImageSnapWebcam"
],
win32: [
"WindowsWebcam"
],
win64: [
"WindowsWebcam"
]
};
//Main test sequence
describe( "Webcam Ubiquity", function() {
//webcam class ubiquity
it( "Should output from it's platforms drivers", ubiquityTest );
});
function ubiquityTest( done ) {
this.timeout( 6000 );
var platform = NodeWebcam.Factory.Platform;
var types = CamTypes[ platform ];
var url = __dirname + "/output/test_image";
Async.map( types, captureFromCam, done );
function captureFromCam( type, callback ) {
var Webcam = new NodeWebcam[ type ];
Webcam.capture( url, function() {
callback();
});
}
}