Book Image

Mastering jQuery

By : Alex Libby
Book Image

Mastering jQuery

By: Alex Libby

Overview of this book

<p>Mastering jQuery has been written not only to help maximize your skills with core functionality in the library, but also to explore some of the more intriguing ways of using the library to achieve real-world solutions that could feature on any website or online environment.</p> <p>You'll start with a look at some of the more advanced ways to incorporate the library into your pages, followed by working with forms and advanced form validation using regular expressions. Next you'll move on to animating in jQuery, advanced event handling, and using jQuery effects.</p> <p>Finally, you will develop practical examples of using jQuery with external functionality such as node-webkit, before finishing with a session on optimizing your version of the library for maximum efficiency and exploring best practices for using QUnit.</p>
Table of Contents (21 chapters)
Mastering jQuery
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Capturing and manipulating webcam images


In our second and final demo for this chapter, we're going to have some fun with a webcam – one of the ways we can acquire and manipulate images is to source them from a laptop or stand-alone webcam.

The key to this demo lies in the use of getUserMedia, which allows us to control audio or video feeds. This is a relatively young API, which requires use of vendor prefixes to ensure full support. As with other APIs, the need for them will disappear over time, so it is worth checking http://caniuse.com/#search=getusermedia regularly to see if support has been updated and the need for prefixes removed.

This demo will bring together some of the concepts we've explored, such as applying filters, saving canvas images to file, and controlling a webcam. To operate this demo correctly, we will need to run it from an HTTP protocol address and not file://. For this, you will either need some web space available, or to use a local webserver such as WAMP (for PC ...