Request the user to start their webcam stream [code] var video= document.querySelector(“#videoElement”); if(navigator.mediaDevices.getUserMedia){ navigator.mediaDevices.getUserMedia({ video: true }) .then(function (stream) { video.srcObject = stream; }) .catch(function (error) { console.log(“Error streaming”); }); } [/code] Using the getUserMedia() API which allows you to access a user’s camera and mic without any plugins Streams have inputs (video) and outputs (video) The if-conditional checks if the getUserMedia is supported Syntax:
[ Read More ]