<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>显示摄像头</title>
</head>
<body>
<video src="" id="video"></video>
</body>
<script>
video = document.getElementById('video')
navigator.mediaDevices.getUserMedia({
video:true
}).then(res=>{
video.srcObject = res //video显示视频流
video.play()
})
</script>
</html>
html5显示摄像头
猜你喜欢
转载自blog.csdn.net/qq_41247335/article/details/104514727
今日推荐
周排行