拍照和录像的操控 对于御三行业级 御3T 不生效
已完成下面是写的代码,这个机型还要设置别的吗
public void startShootPhoto(FlyPhotoAndRecordParam photoAndRecordParam) {
Boolean value = KeyManager.getInstance().getValue(KeyTools.createKey(CameraKey.KeyIsRecording));
if (value) {
showToast("正在录像");
return;
}
KeyManager.getInstance().setValue(KeyTools.createKey(CameraKey.KeyCameraMode), CameraMode.PHOTO_NORMAL, new CommonCallbacks.CompletionCallback() {
@Override
public void onSuccess() {
if (photoAndRecordParam != null) {
KeyManager.getInstance().setValue(KeyTools.createKey(CameraKey.KeyPhotoRatio), PhotoRatio.valueOf(photoAndRecordParam.getPhotoRatio()), new CommonCallbacks.CompletionCallback() {
@Override
public void onSuccess() {
//设置文件类型
KeyManager.getInstance().setValue(KeyTools.createKey(CameraKey.KeyPhotoFileFormat), PhotoFileFormat.valueOf(photoAndRecordParam.getPhotoFileType()), new CommonCallbacks.CompletionCallback() {
@Override
public void onSuccess() {
PhotoSize photoSize = photoAndRecordParam.getPhotoSize().equals("4k") ? PhotoSize.SIZE_DEFAULT : PhotoSize.SIZE_LARGE;
//照片尺寸
KeyManager.getInstance().setValue(KeyTools.createKey(CameraKey.KeyPhotoSize), photoSize, new CommonCallbacks.CompletionCallback() {
@Override
public void onSuccess() {
KeyManager.getInstance().performAction(KeyTools.createKey(CameraKey.KeyStartShootPhoto), new CommonCallbacks.CompletionCallbackWithParam<EmptyMsg>() {
@Override
public void onSuccess(EmptyMsg emptyMsg) {
showToast("拍照成功");
}
@Override
public void onFailure(@NonNull IDJIError error) {
showToast("拍照失败:" + error.errorCode());
}
});
}
@Override
public void onFailure(@NonNull IDJIError error) {
showToast("照片尺寸设置失败" + error.errorCode());
}
});
}
@Override
public void onFailure(@NonNull IDJIError error) {
showToast("照片设置文件类型失败" + error.errorCode());
}
});
}
@Override
public void onFailure(@NonNull IDJIError error) {
showToast("照片比例失败" + error.errorCode());
}
});
}
}
@Override
public void onFailure(@NonNull IDJIError error) {
showToast("设置拍照模式失败" + error.description());
}
});
}
请先登录再写评论。
评论
1 条评论