PhoneGap的/科尔多瓦 - 前置摄像头默认情况下,在Android中 [英] Phonegap/Cordova - Front-facing camera by default in Android

查看:192
本文介绍了PhoneGap的/科尔多瓦 - 前置摄像头默认情况下,在Android中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过在的Andr​​oid接待默认的前置摄像头,但它仍然是使用面向背面相机。可有人请提供完整的code拿到前置摄像头?

I tried the solution at Android Front Facing Camera by default, but still it is using the back-facing camera. Can someone please provide the full code to get the front-facing camera?

推荐答案

cameraDirection属性用于设置摄像机的方向(前/后)。你必须将其添加的选项是这样的:

cameraDirection property is used to set the camera direction(front/back). You have to add it in the options like this:

navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50, cameraDirection:1, destinationType:        destinationType.DATA_URL}); } 

1用于前置摄像头和2是用于面向背面相机

"1" is used for front-facing camera and "2" is used for back-facing camera.

这篇关于PhoneGap的/科尔多瓦 - 前置摄像头默认情况下,在Android中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆