keep-rollin

0.1.0 • Public • Published

Keep Rollin'

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

Readme

Keywords

Package Sidebar

Install

npm i keep-rollin

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

4.79 kB

Total Files

4

Last publish

Collaborators

  • ramshackle-jamathon