Permalink
Browse files

Add webkitGetUserMedia Chrome 18 implementation

  • Loading branch information...
1 parent 88d60ce commit 41f29f7ff8b9f8cc74456ad60933841c77775876 @lempere committed Jan 24, 2012
Showing with 9 additions and 3 deletions.
  1. +1 −1 README
  2. +8 −2 index.html
View
@@ -1 +1 @@
-Simple html to test getUserMedia in Opera 12 alpha browser
+Simple html to test getUserMedia in Opera 12 alpha browser and Google Chrome Canary 18 with these two flags activated --remote-debugging-port=92222 --enable-media-stream
View
@@ -16,11 +16,17 @@
<script>
window.onload = function() {
var video = document.getElementById('sourcevid');
+ navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia;
if (navigator.getUserMedia) {
navigator.getUserMedia('video', successCallback, errorCallback);
function successCallback(stream) {
- video.src = stream;
- console.log('video stream success!');
+ if(window.webkitURL){
+ video.src = window.webkitURL.createObjectURL(stream);
+ console.log('video stream for Chrome success!');
+ }else{
+ video.src = stream;
+ console.log('video stream for Opera12 success!');
+ }
}
function errorCallback(error) {
console.error('An error occurred: [CODE ' + error.code + ']');

0 comments on commit 41f29f7

Please sign in to comment.