Skip to content
A webcam wrapper plugin for jQuery
Branch: master
Clone or download
infusion Merge pull request #42 from extend1994/add-badge
add CDNJS version badge in README.md
Latest commit f9689f9 Oct 26, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Add pauseCamera and resumeCamera to allow camera pausing and resuming Sep 26, 2012
Makefile added verbose output Oct 13, 2010
README.md add CDNJS version badge in README.md May 1, 2017
bower.json Made it release ready Apr 23, 2014
jquery.webcam.js
jquery.webcam.min.js Update jquery.webcam.min.js Jun 21, 2014
jscam.swf added auth-done debug notify Oct 13, 2010
jscam_canvas_only.swf added auth-done debug notify Oct 13, 2010
webcam.jquery.json Made it release ready Apr 23, 2014

README.md

jQuery Webcam Plugin

CDNJS version

Description

A small wrapper library to be able to communicate with a Flash webcam via JavaScript.

Example

Please note: The camera doesn't work if you have any dom-errors on your page!

The Flash object will be embedded into the following Div:

<div id="webcam"></div>
jQuery("#webcam").webcam({

	width: 320,
	height: 240,
	mode: "callback",
	swffile: "/jscam_canvas_only.swf", // canvas only doesn't implement a jpeg encoder, so the file is much smaller

	onTick: function(remain) {

		if (0 == remain) {
			jQuery("#status").text("Cheese!");
		} else {
			jQuery("#status").text(remain + " seconds remaining...");
		}
	},

	onSave: function(data) {

		var col = data.split(";");
    // Work with the picture. Picture-data is encoded as an array of arrays... Not really nice, though =/
	},

	onCapture: function () {
		webcam.save();

 	  // Show a flash for example
	},

	debug: function (type, string) {
		// Write debug information to console.log() or a div, ...
	},

	onLoad: function () {
    // Page load
		var cams = webcam.getCameraList();
		for(var i in cams) {
			jQuery("#cams").append("<li>" + cams[i] + "</li>");
		}
	}
});

If you want to draw the picture onto a canvas, have a look at the source of the page on my blog, linked below.

Further examples and documentation

For further details and code examples take a look at the demonstration and documentation page on:

http://www.xarg.org/project/jquery-webcam-plugin/

License

Copyright (c) 2013, Robert Eisele Dual licensed under the MIT or GPL Version 2 licenses.

You can’t perform that action at this time.