Permalink
Browse files

Adding photo capture via gUM polyfill.

  • Loading branch information...
1 parent ebe9ec9 commit ba3c680d34ab5715f96528d814cc0a81e1671966 @addyosmani committed Apr 21, 2012
Showing with 26 additions and 10 deletions.
  1. +3 −7 css/style.css
  2. +17 −3 index.html
  3. +1 −0 js/getUserMedia.js
  4. +5 −0 js/mylibs/speechBrowser.js
View
@@ -131,13 +131,9 @@ input[type="text"] { font-size:2em; margin:5px}
font-weight: bold;
}
-
-
-
-
-
-
-
+#webcam video{
+ display:none;
+}
.ir { display: block; text-indent: -999em; overflow: hidden; background-repeat: no-repeat; text-align: left; direction: ltr; }
View
@@ -30,8 +30,16 @@
<input name="speechQuery" id="speechQuery" type="text" x-webkit-speech speech error onwebkitspeechchange="speechBrowser.query(true);" />
<!--
<h3>Supports: hello, how is the weather? (variations), what is your name?, search [something something], whats your favorite movie?, define [something], french [something], german [something]</h3>-->
- <h3>Supports: hello (variations), what is your name?, search [something something], whats your favorite movie?, define [something], french [something], german [something]. Did you enjoy yourself?</h3>
+ <h3>Supports conversation like: hello (variations), what is your name?, search [something something], whats your favorite movie?, define [something], french [something], take a picture. Did you enjoy yourself?</h3>
<div id="audio"></div>
+
+ <div id="gum-holder">
+ <div id="webcam"></div>
+ <canvas id="canvas" height="240" width="320"></canvas>
+ <canvas id="output" height="426" width="515"></canvas>
+ </div>
+
+
</form>
<div class="search-case">
<div id="search-results"></div>
@@ -42,8 +50,6 @@
</footer>
</div> <!-- eo #container -->
-
-
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js"></script>
<script>window.jQuery || document.write("<script src='js/libs/jquery-1.7.1.min.js'>\x3C/script>")</script>
<script src="js/mylibs/speechBrowser.js"></script>
@@ -70,6 +76,14 @@
<script type="text/javascript" src="js/mylibs/jquery.translate.js"></script>
+<script type="text/javascript" src="js/getUserMedia.js/dist/getUserMedia.min.js"></script>
+<script type="text/javascript" src="js/getUserMedia.js/face-detection-demo/js/glasses/ccv.js"></script>
+<script type="text/javascript" src="js/getUserMedia.js/face-detection-demo/js/glasses/face.js"></script>
+<script type="text/javascript" src="js/getUserMedia.js/face-detection-demo/js/glasses/stackblur.js"></script>
+<script type="text/javascript" src="js/getUserMedia.js/face-detection-demo/js/demo.js"></script>
+
+
+
</body>
</html>
Submodule getUserMedia.js added at 711d65
@@ -162,6 +162,11 @@ var speechBrowser = function(){
this.textToSpeech('terminator of course.');
this.loadMedia('image','img/terminator.jpg');
}
+ else if(this.similar(qStr, 'take a picture') || this.similar(qStr, 'take another picture')){
+ this.textToSpeech('I hope you like your picture.');
+ window.getSnapshot();
+ }
+
}

0 comments on commit ba3c680

Please sign in to comment.