Permalink
Browse files

added auth-done debug notify

  • Loading branch information...
1 parent e6d76d3 commit a0dddc877112486874b9d6b44396a16a50713fca crypt committed Oct 13, 2010
Showing with 23 additions and 9 deletions.
  1. +9 −8 jquery.webcam.js
  2. BIN jscam.swf
  3. BIN jscam_canvas_only.swf
  4. +14 −1 src/jscam.as
View
@@ -14,7 +14,8 @@
var webcam = {
- id: null,
+ extern: null, // external select token to support jQuery dialogs
+ append: true, // append object instead of overwriting
width: 320,
height: 240,
@@ -37,25 +38,25 @@
if (typeof options === "object") {
for (var ndx in webcam) {
- if (typeof options[ndx] !== "undefined") {
+ if (options[ndx] !== undefined) {
webcam[ndx] = options[ndx];
}
}
}
- var source = '<object id="webcam-object" type="application/x-shockwave-flash" data="'+webcam.swffile+'" width="'+webcam.width+'" height="'+webcam.height+'"><param name="movie" value="'+webcam.swffile+'" /><param name="FlashVars" value="mode='+webcam.mode+'&amp;quality='+webcam.quality+'" /></object>';
+ var source = '<object id="XwebcamXobjectX" type="application/x-shockwave-flash" data="'+webcam.swffile+'" width="'+webcam.width+'" height="'+webcam.height+'"><param name="movie" value="'+webcam.swffile+'" /><param name="FlashVars" value="mode='+webcam.mode+'&amp;quality='+webcam.quality+'" /></object>';
- if (null !== webcam.id) {
- $('#' + webcam.id).html(source);
+ if (null !== webcam.extern) {
+ $(webcam.extern)[webcam.append ? "append" : "html"](source);
} else {
- this.append(source);
+ this[webcam.append ? "append" : "html"](source);
}
(_register = function(run) {
- var cam = document.getElementById('webcam-object');
+ var cam = document.getElementById('XwebcamXobjectX');
- if (typeof cam.capture !== "undefined") {
+ if (cam.capture !== undefined) {
/* Simple callback methods are not allowed :-/ */
webcam.capture = function(x) {
View
BIN jscam.swf
Binary file not shown.
View
Binary file not shown.
View
@@ -54,6 +54,19 @@ class JSCam {
if (null != camera) {
+ // http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary133.html
+ camera.onStatus = function(info:Object) {
+
+ switch (info.code) {
+ case 'Camera.Muted':
+ ExternalInterface.call('webcam.debug', "notify", "Camera stopped");
+ break;
+ case 'Camera.Unmuted' :
+ ExternalInterface.call('webcam.debug', "notify", "Camera started");
+ break;
+ }
+ }
+
camera.setQuality(0, 100);
camera.setMode(Stage.width, Stage.height, 24, false);
@@ -83,7 +96,7 @@ class JSCam {
}
buffer = new BitmapData(Stage.width, Stage.height);
- ExternalInterface.call('webcam.debug', "notify", "Capturing started." + mode);
+ ExternalInterface.call('webcam.debug', "notify", "Capturing started.");
if ("stream" == mode) {
_stream();

0 comments on commit a0dddc8

Please sign in to comment.