Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.onload = function()
- {
- //Gets the user's media
- navigator.getMedia = (
- navigator.getUserMedia ||
- navigator.webkitGetUserMedia ||
- navigator.mozGetUserMedia ||
- navigator.msGetUserMedia
- );
- function onSuccess(stream)
- {
- console.log("Video Loaded");
- var video = document.getElementById("webvideo");
- video.src = window.URL.createObjectURL(stream);
- video.play();
- }
- function onError(err)
- {
- console.log("Could not load video: " + err);
- }
- navigator.getMedia({video : true}, onSuccess, onError);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement