Code implementation based on the HTML5 webcam camera function

Source: Internet
Author: User

Comments: HTML5-based camera (HTML5 webcam) photo function. For more information, see

WebRTC may be the most popular HTML5 standard next year. Mozilla developed a set of APIs to help you control hardware, such as cameras, microphones, and acceleration tables. You can call the local hardware devices you need without relying on other plug-ins.

In this article, we will introduce Photobooth developed by Wolfram Hempel. js, using this class library can help you quickly call the camera function, you can easily add the camera function to the website. You can use this feature to quickly take photos of users. Is it very good?

Main features:
    Contrast settings color settings brightness settings color settings photo buttons support the latest chrome, firefox, opera and other browsers support jQuery plug-ins and javascript code

After using Chrome to open the Online Demo, make sure that the browser is allowed to call your camera, as shown below:

Javascript code:

The Code is as follows:
$ ('# Webcam'). photobooth (). on ("image", function (event, dataUrl ){
$ ('. Nopic'). hide ();
$ ("# Pictures"). prepend (' ');
});

The above code passes the generated image data to the label id = picture. For more information, see related APIs.
Source code download

We hope you will like this Online demo and demo. If you have any questions, please leave us a message. Thank you!


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.