Answers for "html camera"

1

install ansible in ubuntu

On Fedora:
$ sudo dnf install ansible

On RHEL and CentOS:
$ sudo yum install ansible

On Ubuntu:
$ sudo apt-add-repository --yes --update ppa:ansible/ansible
$ sudo apt install ansible

Using PIP:
$ pip install --user ansible

On Alpine:
$ apk add ansible

sudo apt install ansible
Posted by: Guest on October-19-2020
3

how to add a camera in html

<video autoplay></video>

    <script>
    const constraints = {
      video: true,
    };
    
    const video = document.querySelector("video");
    
    navigator.mediaDevices.getUserMedia(constraints).then((stream) => {
      video.srcObject = stream;
    });
    </script>
Posted by: Guest on December-18-2020
3

js access webcam

<!DOCTYPE html>
<html>
<body>
	<div id="container">
		<video autoplay="true"></video>
	</div>
	<button class="btn" onclick="startWebCam()">Start</button>
	<script type="text/javascript">
		var video = document.querySelector("video");
		function startWebCam() {
			if (navigator.mediaDevices.getUserMedia) {
				navigator.mediaDevices.getUserMedia({ video: true })
			    	.then(function (stream) {
			      		video.srcObject = stream;
			    	})
			    	.catch(function (err0r) {
			      		console.log("Something went wrong!");
			    	});
			}
		}
		startWebCam();
	</script>
</body>
</html>
Posted by: Guest on October-20-2020

Browse Popular Code Answers by Language