Permalink
Browse files

Added support for opera

  • Loading branch information...
1 parent f09af00 commit 432f7e84160bbb5b2ba0cffd122aa4e78cbd332c @wesbos wesbos committed Mar 24, 2012
Showing with 13 additions and 4 deletions.
  1. BIN .DS_Store
  2. +3 −2 index.html
  3. +10 −2 scripts/scripts.js
View
BIN .DS_Store
Binary file not shown.
View
@@ -6,8 +6,9 @@
<body>
<div class="wrapper">
<!-- Our Main Video Element -->
- <video height="426" width="640" controls autoplay></video>
-
+ <video height="426" width="640" controls autoplay style="width:100px; height:75px;"></video>
+ <a href="#" onclick="App.start('glasses');">Glasses!</a>
+ <br>
<!-- Out Canvas Element for output -->
<canvas id="output" height="426" width="515" ></canvas>
View
@@ -5,7 +5,12 @@ var App = {
// Run if we do have camera support
successCallback : function(stream) {
console.log('yeah! camera support!');
- App.video.src = window.webkitURL ? window.webkitURL.createObjectURL(stream) : stream;
+ if(window.webkitURL) {
+ App.video.src = window.webkitURL ? window.webkitURL.createObjectURL(stream) : stream;
+ }
+ else {
+ App.video.src = stream;
+ }
},
// run if we dont have camera support
@@ -112,8 +117,11 @@ App.init = function() {
if (navigator.webkitGetUserMedia) {
navigator.webkitGetUserMedia('video', App.successCallback, App.errorCallback);
}
+ else if (navigator.getUserMedia) {
+ navigator.getUserMedia('video', App.successCallback, App.errorCallback);
+ }
- App.start();
+ // App.start();
};

0 comments on commit 432f7e8

Please sign in to comment.