keep-rollin
v0.1.0
Published
gettin that webcam stream with getUserMedia
Downloads
8
Maintainers
Readme
Keep Rollin'
Installation
$ npm install keep-rollin
Usage
var Webcam = require("keep-rollin");
var webcam = new Webcam({
minWidth: 1920, // default: 1280
minHeight: 1080, // default: 720
minFrameRate: 30, // default: 60
});
var webcamTexture;
function renderLoop(){
if(webcam.video.readyState === webcam.video.HAVE_ENOUGH_DATA) {
if(webcamTexture) {
webcamTexture.setPixels(webcam.video);
} else {
webcamTexture = funcThatMakesATextureFromAStream(webcam.video);
}
this.shader.uniforms.uWebcamTexture = this.webcamTexture.bind();
}
/*
...doing neat things
*/
window.requestAnimationFrame(renderLoop);
}
window.requestAnimationFrame(renderLoop);
Badges