2

我的 Sencha touch 混合应用程序使用户能够使用带有Cordova插件的设备本机相机从应用程序中拍摄照片。但我想disable the front facing camera。用户不应该能够在前后摄像头之间切换。我尝试了cameraDirection10但这仅有助于在前后摄像头之间切换,而不是禁用前置摄像头。任何帮助将不胜感激。

navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50, destinationType: navigator.camera.DestinationType.DATA_URL, correctOrientation: true, cameraDirection: 0 });
4

1 回答 1

1

您可以通过以下选项找到解决方案:

cameraDirection: Choose the camera to use (front- or back-facing). Defined in navigator.camera.Direction (Number)

Camera.Direction = {
    BACK : 0,      // Use the back-facing camera
    FRONT : 1      // Use the front-facing camera
};

参考: https ://cordova.apache.org/docs/en/3.3.0/cordova/camera/parameter/cameraOptions.html

希望这会帮助/指导你。

于 2019-01-18T08:49:08.960 回答