PHP - Webcam & Php
i have a chat room where i've created using AJAX n i wonder how can i add a webcam for my chatroom?? Is there anything i mean software to be added or installed??
Any guides?? thanks Similar TutorialsThis topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=343384.0 I'm using jQuery webcam to capture a photo of the client. I need to send it to the server just when the form is submitted (It's a form with information, and I need to have the photo attached to it). I have everything working except the part of saving the image encoded with base64 to the database like blob. Here is what I have so far: Code: [Select] <script type="text/javascript"> var pos = 0; var ctx = null; var cam = null; var image = null; jQuery("#webcam").webcam({ width: 320, height: 240, mode: "callback", swffile: "/../../js/jscam_canvas_only.swf", onTick: function(remain) { if (0 == remain) { jQuery("#status").text("Sorria!"); } else { jQuery("#status").text(remain + " segundo(s) restante(s)..."); } }, onSave: function(data) { var col = data.split(";"); var img = image; for(var i = 0; i < 320; i++) { var tmp = parseInt(col[i]); img.data[pos + 0] = (tmp >> 16) & 0xff; img.data[pos + 1] = (tmp >> 8) & 0xff; img.data[pos + 2] = tmp & 0xff; img.data[pos + 3] = 0xff; pos+= 4; } if (pos >= 4 * 320 * 240) { ctx.putImageData(img, 0, 0); var canvas = document.getElementById("canvas"); var save_image = canvas.toDataURL("image/png"); save_image = save_image.replace(/^data:image\/(png|jpeg);base64,/, ""); $('input[name=save_image]').val(save_image); pos = 0; } }, onCaptu function () { jQuery("#flash").css("display", "block"); jQuery("#flash").fadeOut(100, function () { jQuery("#flash").css("opacity", 1); }); jQuery("#canvas").show(); webcam.save(); }, onLoad: function () { var cams = webcam.getCameraList(); for(var i in cams) { jQuery("#cams").append("<li>" + cams[i] + "</li>"); } jQuery("#canvas").hide(); } }); function getPageSize() { var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = window.innerWidth + window.scrollMaxX; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } var windowWidth, windowHeight; if (self.innerHeight) { // all except Explorer if(document.documentElement.clientWidth){ windowWidth = document.documentElement.clientWidth; } else { windowWidth = self.innerWidth; } windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { // other Explorers windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } // for small pages with total height less then height of the viewport if(yScroll < windowHeight){ pageHeight = windowHeight; } else { pageHeight = yScroll; } // for small pages with total width less then width of the viewport if(xScroll < windowWidth){ pageWidth = xScroll; } else { pageWidth = windowWidth; } return [pageWidth, pageHeight]; } window.addEventListener("load", function() { jQuery("body").append("<div id=\"flash\"></div>"); var canvas = document.getElementById("canvas"); if (canvas.getContext) { ctx = document.getElementById("canvas").getContext("2d"); ctx.clearRect(0, 0, 320, 240); var img = new Image(); img.onload = function() { ctx.drawImage(img, 320, 240); } image = ctx.getImageData(0, 0, 320, 240); } var pageSize = getPageSize(); jQuery("#flash").css({ height: pageSize[1] + "px" }); }, false); window.addEventListener("resize", function() { var pageSize = getPageSize(); jQuery("#flash").css({ height: pageSize[1] + "px" }); }, false); </script> Then I have just a normal form that the customer has to fill it in, followed by this: Code: [Select] <div id="webcam"> </div> <p style="width:250px;text-align:center; "><input type="button" value="Tirar Fotografia" onclick="webcam.capture(3);void(0);"/></p></td><td><p><canvas id="canvas" height="200" width="200"></canvas></p> in php i have: Code: [Select] $image=file_get_contents(base64_decode($_POST['save_image'])); Hi, I am making login page with database and php. I need to be able when the person clicks theogin button to take photo of the person and add it to that same database based on the info entered.
I am doing this to know if that person that logged in is the person in reality.
Is it possible I tried both of these articles, I have a windows 8.1 tablet and both of the different "codes" worked but I tried my friend's iPhone and the camera viewport is just a black square or doesn't show at all... the problem seems to be that the pop up where you push "allow" or "deny" doesn't show up at all, this makes me think the trigger isn't "triggered".
These are the sites
I'm using HTML5 and Javascript, didn't do much modifcation yet, I just needed the basic web cam access, cropping, saving functions at the moment.
http://davidwalsh.name/browser-camera
http://mycodingtrick...ipt/webcam-api/
i cant find any working stuff on this i cant just start learning as3 and flash development for a small feature :\ i found this two guides: http://www.marchawkins.com/2010/03/17/capture-and-upload-a-webcam-still-with-flash/ dont work for me do error couldnt make it work :| http://www.endseven.net/?p=9# didnt work for me to... im beggin you guys i really need this script just a simple snap from webcam and it upload to the site thats it. Hi, I am creating an access control page where my end user swipes his card and the page auto submits. At this stage I want to click his/her picture as well. The challenge is I am unable to find a script where a webcam clicks on page refresh or when it auto submits.. All the scripts i have seen only work on a click which is not possible here as the only user input is a swipe which has an autosubmit. |