<video src=""></video> <script type="text/javascript"> var opt = { audio: true, video: { width: 375, height: 603 } }; navigator.mediaDevices.getUserMedia(opt) .then(function(mediaStream) { var video = document.querySelector('video'); video.srcObject = mediaStream; video.onloadedmetadata = function(e) { video.play(); }; }) .catch(function(err) { console.log(err.name + ": " + err.message); }); // always check for errors at the end.
调用摄像头API
最新推荐文章于 2024-09-11 23:32:39 发布