【发布时间】:2016-02-17 07:14:43
【问题描述】:
我正在使用 Cordova 在 Visual Studio 2015 中为 Windows Phone 创建混合应用程序。 我在面对前置摄像头时遇到了摄像头方向问题。
这是我的代码
if (!navigator.camera) {
alert("Camera API not supported", "Error");
deffered.reject('Unable to open camera');
return deffered.promise;
};
if( direction === undefined ) {
direction = 0;
}
var options = {
quality: 50,
destinationType: Camera.DestinationType.FILE_URI,
sourceType: 1, // 0:Photo Library, 1=Camera, 2=Saved Album
encodingType: 0, // 0=JPG 1=PNG
cameraDirection: direction // 0 for back, 1 for front
};
navigator.camera.getPicture(
function( imgData ) {
deffered.resolve(imgData);
},
function (message) {
console.log(message);
deffered.reject('Unable to open camera');
},
options);
return deffered.promise;
}
当相机打开时,方向将相反。
它拍摄相反的图像 我试过了
cameraOrientation : 0 or 1 but it makes camera green screen only.
【问题讨论】:
标签: cordova camera windows-phone-8.1 navigator