代码如下(直接用的是官网的代码没有任何修改):
设备配置:iPhone7 ios版本13.3.1
复制代码<html>
<head>
<meta charset="utf-8">
<title>Camera Example</title>
<script type="text/javascript">
// 扩展API加载完毕后调用onPlusReady回调函数
document.addEventListener( "plusready", onPlusReady, false );
// 扩展API加载完毕,现在可以正常调用扩展API
function onPlusReady() {
console.log("plusready");
}
// 摄像
function videoCapture(){
var cmr = plus.camera.getCamera();
var res = cmr.supportedVideoResolutions[0];
var fmt = cmr.supportedVideoFormats[0];
console.log("Resolution: "+res+", Format: "+fmt);
cmr.startVideoCapture( function( path ){
alert( "Capture video success: " + path );
},
function( error ) {
alert( "Capture video failed: " + error.message );
},
{resolution:res,format:fmt}
);
}
</script>
</head>
<body>
<button onclick="videoCapture()">摄像</button>
</body>
</html>
1 个回复
m***@163.com
我是iphone 6plus ,白屏,调起摄像头后,拍照完成,点 使用照片,,就崩溃了