Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding photo capture via gUM polyfill.

  • Loading branch information...
commit ba3c680d34ab5715f96528d814cc0a81e1671966 1 parent ebe9ec9
@addyosmani authored
View
10 css/style.css
@@ -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
20 index.html
@@ -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>
1  js/getUserMedia.js
@@ -0,0 +1 @@
+Subproject commit 711d65630ff29ebfda86877fb7da2e0f3a6232f3
View
5 js/mylibs/speechBrowser.js
@@ -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();
+ }
+
}
Please sign in to comment.
Something went wrong with that request. Please try again.