调用摄像头并展示视频
代码如下:
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Lookie Lookie!</title>
<meta name="description" content="A website that learns to predict where you are looking at. Written in TensorFlow.js">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
</head>
<body>
<video id="webcam" width="400" height="300" autoplay></video>
</body>
<script>
var video = document.querySelector("#webcam");
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia({ video: true })
.then(
本文转载自: https://blog.csdn.net/guige8888811/article/details/140852056
版权归原作者 web前端神器 所有, 如有侵权,请联系我们删除。
版权归原作者 web前端神器 所有, 如有侵权,请联系我们删除。