Skip to content

Commit

Permalink
added auth-done debug notify
Browse files Browse the repository at this point in the history
  • Loading branch information
crypt committed Oct 13, 2010
1 parent e6d76d3 commit a0dddc8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
17 changes: 9 additions & 8 deletions jquery.webcam.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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) {
Expand Down
Binary file modified jscam.swf
Binary file not shown.
Binary file modified jscam_canvas_only.swf
Binary file not shown.
15 changes: 14 additions & 1 deletion src/jscam.as
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit a0dddc8

Please sign in to comment.