Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is a new technology. Yoy must have a Firefox/Chrome/Opera browser and it has to be updated. Then, try this: </p> <pre><code>function showCamera() { var streaming = false, video = window.content.document.createElement("video"), cover = window.content.document.createElement("div"), canvas = window.content.document.createElement("canvas"), photo = window.content.document.createElement("img"), startbutton = window.content.document.createElement("button"), width = 320, height = 0; photo.src = "http://placekitten.com/g/320/261"; window.content.document.body.insertBefore(video, window.content.document.body.firstChild); var navigator = window.navigator; navigator.getMedia = ( navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia); navigator.getMedia( { video: true, audio: false }, function(stream) { if (navigator.mozGetUserMedia) { video.mozSrcObject = stream; } else { var vendorURL = window.URL || window.webkitURL; video.src = vendorURL.createObjectURL(stream); } video.play(); }, function(err) { console.log("An error occured! " + err); } ); video.addEventListener('canplay', function(ev){ if (!streaming) { height = video.videoHeight / (video.videoWidth/width); video.setAttribute('width', width); video.setAttribute('height', height); canvas.setAttribute('width', width); canvas.setAttribute('height', height); streaming = true; } }, false); function takepicture() { canvas.width = width; canvas.height = height; canvas.getContext('2d').drawImage(video, 0, 0, width, height); var data = canvas.toDataURL('image/png'); photo.setAttribute('src', data); } startbutton.addEventListener('click', function(ev){ takepicture(); ev.preventDefault(); }, false); } showCamera(); </code></pre> <p>If your browser is Firefox and still not working, go to about:config and set/add a boolean variable with a true value called media.navigator.enabled</p> <p>Source: <a href="https://developer.mozilla.org/en-US/docs/WebRTC/Taking_webcam_photos" rel="nofollow">https://developer.mozilla.org/en-US/docs/WebRTC/Taking_webcam_photos</a></p> <p>P/d: I used this code in a Greasemonkey script and it worked. I did some few changes on firsts lines of the original code.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload