Browse files

minor revisions to readme

  • Loading branch information...
1 parent 152f0c3 commit 86510204e7569f3f0f99eae485d1209ddc075840 @addyosmani committed Apr 4, 2012
Showing with 10 additions and 5 deletions.
  1. +10 −5 README.md
View
15 README.md
@@ -1,20 +1,22 @@
#getUserMedia.js
-getUserMedia.js is a cross-browser shim for the [getUserMedia() API](http://dev.w3.org/2011/webrtc/editor/getusermedia.html) (now a part of [WebRTC](http://www.webrtc.org/)) that supports accessing a local camera device from inside the browser. Where WebRTC support is detected, it will use the browser's native getUserMedia() implementation, otherwise a Flash fallback will be loaded instead.
+getUserMedia.js is a cross-browser shim for the [getUserMedia() API](http://dev.w3.org/2011/webrtc/editor/getusermedia.html) (now a part of [WebRTC](http://www.webrtc.org/)) that supports accessing a local camera device from inside the browser. Where WebRTC support is detected, it will use the browser's native ```getUserMedia()``` implementation, otherwise a Flash fallback will be loaded instead.
As you can see in the [demo](http://addyosmani.github.com/getUserMedia.js/demo.html), what the shim provides is more than enough to create interactive applications that can relay device pixel information on to other HTML5 elements such as the canvas. By relaying, you can easily achieve tasks like capturing images which can be saved, applying filters to the data, or as shown in the demo, even perform tasks like facial detection.
-The shim currently works in all modern browsers with support for IE still being evaluated (IE8+ support will at minimum be targeted). Note that the API for this project is still under development and is currently being tweaked. I may end up refactoring this into a jQuery plugin, but wish to keep it vanilla for the time-being.
+The shim currently works in all modern browsers and IE8. Note that the API for this project is still under development and is currently being tweaked. I may end up refactoring this into a jQuery plugin, but wish to keep it vanilla for the time-being.
##Walkthough
-Getting the shim working is fairly straight-forward. First, include the ```getusermedia.js``` script in your page.
+Getting the shim working is fairly straight-forward, but you may be interested in checking out the sample application in demo.html for further information.
+
+First, include the ```getusermedia.js``` script in your page.
```javascript
<script src="js/getusermedia.js"></script>
```
-Next, define some mark-up that we can use as a container for the video stream. Below you'll notice that a simple ```div``` has been opted for (as per our demo(. What will happen when we initialize the shim with it is we will either inject a ```video``` tag for use (if WebRTC is enabled) or alternatively an ```object``` tag if the Flash fallback needs to be loaded instead. Whilst most modern browsers will support the ```video``` tag, there is no reason to be using it here if your only interest is relaying the video data for further processing or use elsewhere.
+Next, define mark-up that we can use as a container for the video stream. Below you'll notice that a simple ```div``` has been opted for (as per our demo). What will happen when we initialize the shim with it is we will either inject a ```video``` tag for use (if WebRTC is enabled) or alternatively an ```object``` tag if the Flash fallback needs to be loaded instead. Whilst most modern browsers will support the ```video``` tag, there is no reason to be using it here if your only interest is relaying the video data for further processing or use elsewhere.
```
<div id="webcam"></div>
@@ -30,7 +32,7 @@ where ```options``` is an object containing configuration data, ```success``` is
We use the configuration object (```options``` in the above) to specify details such as the element to be used as a container, (e.g ```webcam```), the quality of the fallback image stream (```85```) and a number of additional callbacks that can be further used to trigger behaviour.
-For the most part, any callback beginning with ```on``` in the below example is a Flash-fallback specific callback. If you don't need to use it, feel free to exclude it from your code.
+Callbacks beginning with ```on``` in the below example is a Flash-fallback specific callback. If you don't need to use it, feel free to exclude it from your code.
```javascript
var options = {
@@ -50,6 +52,9 @@ var options = {
width: 320,
height: 240,
+ // the recommended mode to be used is 'callback'
+ // where a callback is executed once data
+ // is available
mode: "callback",
// the flash fallback Url

0 comments on commit 8651020

Please sign in to comment.