無法使用 HTML5 在首次載入頁面時從網路攝像頭拍攝照片
您需要嘗試以下操作才能使用 HTML5 從網路攝像頭拍攝照片
宣告變數
var streaming = false, video = document.querySelector('#video'), canvas = document.querySelector('#canvas'), photo = document.querySelector('#photo'), startbutton = document.querySelector('#startbutton'), width = 320, height = 0;
使用 getUserMedia
navigator.getMedia = ( navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia);
廣告