Advertisement
Guest User

Mozilla Woes

a guest
Feb 21st, 2013
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. window.onload = function()
  2. {
  3.     //Gets the user's media
  4.     navigator.getMedia = (
  5.                 navigator.getUserMedia ||
  6.                 navigator.webkitGetUserMedia ||
  7.                 navigator.mozGetUserMedia ||
  8.                 navigator.msGetUserMedia
  9.     );
  10.        
  11.     function onSuccess(stream)
  12.     {
  13.         console.log("Video Loaded");
  14.         var video = document.getElementById("webvideo");
  15.         video.src = window.URL.createObjectURL(stream);
  16.         video.play();
  17.        
  18.     }
  19.    
  20.     function onError(err)
  21.     {
  22.         console.log("Could not load video: " + err);
  23.     }
  24.    
  25.     navigator.getMedia({video : true}, onSuccess, onError);
  26.    
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement