|
|
@@ -219,9 +219,9 @@ |
|
|
|
$("#showImg").show(); //将拍照结果显示 |
|
|
|
}); |
|
|
|
// 遍历所有的设备,包括视频和音频设备,找到摄像头 |
|
|
|
function gotDevices(deviceInfos) { |
|
|
|
console.log(deviceInfos); |
|
|
|
} |
|
|
|
//function gotDevices(deviceInfos) { |
|
|
|
// console.log(deviceInfos); |
|
|
|
//} |
|
|
|
|
|
|
|
function handleError(error) { |
|
|
|
console.log('Error: ', error); |
|
|
@@ -273,7 +273,7 @@ |
|
|
|
console.log('menumerateDevices is not supported!'); |
|
|
|
} else { |
|
|
|
navigator.mediaDevices.enumerateDevices() |
|
|
|
.then(gotDevices).catch(handleError); |
|
|
|
.then(takePhoto).catch(handleError); |
|
|
|
} |
|
|
|
//takePhoto(); |
|
|
|
} |
|
|
|