

JQuery Webcam Plugin - Communicate with a webcam directly from JS - benjaminfox
http://www.xarg.org/project/jquery-webcam-plugin/

======
wccrawford
"to communicate with a camera directly in JavaScript."

"error: Flash movie not yet registered!"

Some people seem to have a different definition for "directly" than I do.

This works -through- Flash. Without Flash, you get nothing. It's not
"directly" with Javascript at all.

------
shib71
I love jQuery, but I don't see why it is required here. Wouldn't this code
work just as well with a couple of element IDs, and add library independence
to the bargain?

~~~
dimarco
jQuery sells.

~~~
noodle
odds are, in this instance its because it looks nice on a resume.

------
uptown
I find it interesting that JavaScript can apparently determine what video
camera you have connected to you PC even without the acknowledgment of the
Flash Approve/Deny access dialogue.

~~~
liuliu
That's exactly the problem why our plugin (<http://api.alii.tv>) doesn't add
the webcam output. I cannot figure out a good way to acknowledge user about
the use of webcam and the potential security risk turns me down. Obviously,
another problem is how to transmit the decompressed data in real-time to
browser. I am interested to see their solution to the both problems.

------
robin_reala
The W3 are working on standardising a proper (i.e. non-Flash) audio/video
capture API for JS to interact with: <http://www.w3.org/TR/html-media-
capture/>

------
there
directly from JS! (and flash)

~~~
extension
Which means no phone cameras, though that could conceivably work on Android
some day.

~~~
ergo98
If you're talking about Flash, note that at the last Google device convention
they promised that soon they would have Android JavaScript access to the
cameras sans Flash. I'm sure that will carry to ChromeOS and Chrome as well.

[http://stackoverflow.com/questions/2953865/javascript-
camera...](http://stackoverflow.com/questions/2953865/javascript-camera-api-
android-froyo)

~~~
ianhawes
I don't think it's Flash they're using, but rather the HTML5 <device> tag.
Expect that in Chrome very soon, and in IE16, probably by about 2021.

~~~
ergo98
Sorry, I suppose I worded confusingly, however I was offering that as a non-
Flash option. My point being that if they assume that Android will offer that
soon because of Flash, it will also offer it natively.

------
simonw
This is really useful - as a non Flash developer I love it when people release
neat, unobtrusive scripts that make Flash-only capabilities available through
JavaScript.

It's not clear how this would work in older browsers that don't support canvas
though.

Anyone seen anything like this but for audio instead? I'd love a way to record
audio from JavaScript and stream it to a server.

~~~
ars
Uh, this is flash.

The jQuery and JS parts play only minor roles.

~~~
simonw
I know that. I'm asking if anyone has seen a similar unobtrusive Flash widget
that provides a JavaScript API for accessing audio input.

UPDATE: After a bit of searching around, it looks like there are no convenient
APIs within the Flash player itself for recording audio to any kind of object
that could then be uploaded - instead, you need to have an open network
connection to either Flash Media Server or Red5 (the open source equivalent)
and then get the server to encode to MP3.

~~~
chopsueyar
There is also Wowza.

------
danfitch
I like this alot but the technology is still not there to be able to stream
video and audio without flash. I wrote the site <http://www.squarechat.com>
and try to use as much javascript as I can and only flash where it is
necessary but I would love to be able to ditch flash and have video and audio
streaming support.

~~~
jasonkester
Got an API for that? If not, build one and people like me will pay you to
embed video/audio chat in our apps.

------
relix
Uses a very non-optimized way to generate the JPEG. This is the way it was
done in 2007, but now there's a built-in JPEG compression function in the API
available. He's using Adobe's example AS3 JPEG code.

------
PanMan
Unfortunately, it doesn't work with flashblock. Even when I enable the flash,
the javascript doesn't pick up on that and doesn't work. I guess it only
checks on document load.

------
gord
Id like a simpler feature - to be able to upload a photo from the iPhone via
Safari Webkit [upload file form field]. Its such a pain to have to work around
this in web apps.

------
jhuckestein
Is it fast enough for real-time modification of the data? What if I want to do
image recognition and want to ad, let's say sunglasses, to the person's face?

