Jump to content

javascript + webcam


Matej

Recommended Posts

Hello gentlemen

 

 

i'd like to "connect" webcam and my website with webcam(something like chatroullete but instead , you will see your own image from webcam , you and only you") but i have no idea how to do it .

 

Would you be so kind and give me some hint or idea how to do it?

 

Thanks , and have a nice day.

Link to comment
Share on other sites

Thanks , i made it working with this

 

var video = document.querySelector("#videoElement");navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia;if (navigator.getUserMedia) {navigator.getUserMedia({video: true}, handleVideo, videoError);}function handleVideo(stream) {video.src = window.URL.createObjectURL(stream);}function videoError(e) {// do something}

 

i put it in function and made it onclick event , but i was wondering , how could i make that function stop?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...