• Stars
    star
    516
  • Rank 85,726 (Top 2 %)
  • Language ActionScript
  • Created about 14 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A webcam wrapper plugin for jQuery

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.

More Repositories

1

Fraction.js

Fraction is a rational numbers library written in JavaScript
JavaScript
422
star
2

node-dhcp

A DHCP server and client written in pure JavaScript
JavaScript
296
star
3

PHP-Facedetect

A simple OpenCV wrapper for PHP to detect faces on images
C++
265
star
4

GPS.js

A NMEA parser and GPS utility library
JavaScript
248
star
5

jQuery-Paging

Probably the most advanced jQuery pagination plugin, no really!
HTML
233
star
6

Complex.js

Complex.js is a com numbers library written in JavaScript
JavaScript
229
star
7

BitSet.js

An arbitrary size Bit-Vector implementation in JavaScript
JavaScript
220
star
8

jQuery-xcolor

An easy to use color manipulation plugin for jQuery
JavaScript
160
star
9

PHP

A PHP improvement
C
139
star
10

udf_infusion

A MySQL functionality enhancement UDF
Shell
136
star
11

Polynomial.js

A JavaScript library to work with polynomials
JavaScript
122
star
12

Quaternion.js

A JavaScript Quaternion library
JavaScript
115
star
13

Fritzing

My fritzing sketches
C++
65
star
14

node-gamecontroller

A node.js driver for several gamecontrollers
JavaScript
55
star
15

HTML5-Tetris

A HTML5 Tetris Implementation
JavaScript
44
star
16

Trackball.js

A library to add a virtual Trackball to your DOM
JavaScript
34
star
17

HTML5-Experiments

My HTML5 Experiments
HTML
33
star
18

Kalman.js

A JavaScript Kalman filter library
JavaScript
30
star
19

PHP-Daemon

PHP
30
star
20

Stewart

Inverse kinematics for Stewart Platforms written in JavaScript
JavaScript
25
star
21

Rectangles.js

Rectangles.js is a collection of functions to work with rectangles
JavaScript
20
star
22

Angles.js

Angles.js is a collection of functions to work with angles
JavaScript
17
star
23

PHP-Classes

A collection of PHP classes
PHP
15
star
24

PHP-Defcon

A global constant management library for PHP
C
14
star
25

JavaScript-Files

A collection of JavaScript files
JavaScript
11
star
26

Circle.js

A function collection for working with circles
JavaScript
11
star
27

node-dsh

A full featured JavaScript shell
JavaScript
9
star
28

PHP-IDNA

A libidn wrapper for PHP
C
5
star
29

PHP-Infusion

A PHP functionality enhancement library
C
5
star
30

PHP-Sysload

A simple sysload monitoring extension for PHP
C
3
star
31

mod_mysql_accesslog

A lighttpd module to log directly into MySQL
C
3
star
32

UnitFormat.js

A human readable unit formatting tool in JavaScript
JavaScript
2
star
33

jQuery-borderstyle

A handy jQuery plugin to manipulate the border stlye CSS attributes
JavaScript
1
star