- Start and Stop Web Cam using getUserMedia HTML5 feature.
- <html>
- <head>
- <meta charset="utf-8">
- <title>JS Bin</title>
- <script>
- navigator.getUserMedia = ( navigator.getUserMedia ||
- navigator.webkitGetUserMedia ||
- navigator.mozGetUserMedia ||
- navigator.msGetUserMedia);
- var webcamStream;
- function startWebCam() {
- if (navigator.getUserMedia) {
- navigator.getUserMedia (
- // constraints
- {
- video: true,
- audio: false
- },
- // successCallback
- function(localMediaStream) {
- var video = document.querySelector('video');
- video.src = window.URL.createObjectURL(localMediaStream);
- webcamStream = localmediaStream;
- },
- // errorCallback
- function(err) {
- console.log("The following error occurred: " + err);
- }
- );
- } else {
- console.log("getUserMedia not supported");
- }
- }
- function stopWebcam() {
- webcamStream.stop();
- }
- </script>
- </head>
- <body >
- <video width=200 height=200 id="video" controls autoplay></video>
- <button onclick="startWebcam();">Start Webcam</button>
- <button onclick="stopWebcam();">Stop Webcam</button>
- </body>
- </html>
Thursday, June 25, 2015
getUserMedia Advance Features of HTML5 WebCam Kit
Subscribe to:
Post Comments (Atom)
How To Gamble Online With Casino Sites in Illinois
ReplyDeleteWhen it 여주 출장마사지 comes to online gambling, there are many ways 토토 사이트 you can wager online. You can pick up 평택 출장안마 the cash or cash 광주광역 출장샵 games offered on 의정부 출장안마 any of the