Matej Posted June 1, 2014 Share Posted June 1, 2014 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 More sharing options...
justsomeguy Posted June 2, 2014 Share Posted June 2, 2014 The WebRTC feature in HTML5 will allow access to a camera and microphone in browsers that support it.http://stackoverflow.com/questions/15417036/how-to-access-the-webcam-by-javascript Link to comment Share on other sites More sharing options...
Matej Posted June 3, 2014 Author Share Posted June 3, 2014 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 More sharing options...
justsomeguy Posted June 3, 2014 Share Posted June 3, 2014 A function stops at the end of the code. If you're asking how to turn off the video or something, check the WebRTC documentation. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now