[英]Accessing webcam in my webpage, video not showing even if the browser has the access in the cam
我正在嘗試使用我的網站中的網絡攝像頭捕獲照片,但問題是視頻沒有顯示在網頁中,即使瀏覽器已經可以在此處訪問Java腳本了
<script type ="text/javascript">
(function(){
var video = document.getElementById('video'),
vendorUrl = window.URL || window.webkitURL;
navigator.getMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
navigator.getMedia({
video: true,
audio: false
}, function(stream){
video.scr = vendorUrl.createObjectURL(stream);
video.play();
}, function(error){
});
})();
然后在這里我要顯示凸輪並捕獲圖像
<div class="col-lg-12">
<div class="col-lg-2">
<!--Webcam-->
<!--<img border-radius: 50%; src="image" alt="Student Image">-->
<video id="video" width="200" height="200"></video>
</div>
<div class="col-lg-2">
Select Picture File to Upload: <input type="file" name="image">
</div>
提前致謝
錯別字。 應該
video.src = ...
不
video.scr = ...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.