Skip to content

Commit

Permalink
Added support for opera
Browse files Browse the repository at this point in the history
  • Loading branch information
wesbos committed Mar 24, 2012
1 parent f09af00 commit 432f7e8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Binary file modified .DS_Store
Binary file not shown.
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
12 changes: 10 additions & 2 deletions scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();

};

Expand Down

0 comments on commit 432f7e8

Please sign in to comment.