Comment: The super cool camera (HTML5 webcam) photography function implemented based on HTML5. Friends who need to know can refer to it
WebRTC may be the most popular HTML5 standard next year, and Mozilla has developed a set of APIs that help you control hardware, such as cameras, microphones, or acceleration meters. You can call the native hardware device you need without relying on other plugins.
In this article today, we will introduce Photobooth.js developed by Wolfram Hempel. Using this library can help you quickly call the camera function, and you can easily add the camera function to the website. And it will quickly help you take photos. You can use this function to achieve user's big headshots. Isn't it very good?
Main features: Contrast setting, color setting, brightness setting, tone setting, photo button supports the latest chrome, firefox, opera and other browsers to support jQuery plug-in and javascript code methodsAfter opening the online demo with Chrome, please make sure that the browser allows the browser to call your camera, as follows:
Javascript code:$('#webcam').photobooth().on("image",function( event, dataUrl ){
$('.nopic').hide();
$( "#pictures" ).prepend( '<img src="' + dataUrl + '" >');
});
The above code passes the generated image data to the tag with id=picture. For details, please refer to the relevant API.
Source code download
I hope everyone likes this online demonstration and demo we provide. If you have any questions, please leave us a message, thank you!