Teaching Newbies since 2014

kauress

  • Home
  • Javascript ❤
    • JavaScript
    • Node.js
  • WebDev Tuts
  • screencasts
  • Resources
  • VR & AR
  • Contact
  • Github
  • Twitter
  • YouTube
  • RSS
  • C++
You are here: Home / Archives for vidoe

April 13, 2020 by: Kauress

Stream video with getUserMedia()

getusermedia() image

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 ]

Copyright © 2021 ·Kauress