【发布时间】:2014-07-25 14:47:39
【问题描述】:
我正在尝试使用 Sony Camera Remote API 设置“闪光模式”。
我使用的相机是 DSC-RX100M3。
由于当前(Beta)版本的 Android API 不包含此方法,我不得不添加它:
public JSONObject setFlashMode(String strMode) throws IOException {
String service = "camera";
try {
JSONObject requestJson = new JSONObject()
.put("method", "setFlashMode")
.put("params", new JSONArray().put(strMode))
.put("id", id())
.put("version", "1.0");
String url = findActionListUrl(service) + "/" + service;
log("Request: " + requestJson.toString());
String responseJson = SimpleHttpClient.httpPost(url,
requestJson.toString());
log("Response: " + responseJson);
return new JSONObject(responseJson);
} catch (JSONException e) {
throw new IOException(e);
}
}
问题是,我从摄像头收到 403(禁止)错误。这是什么意思?
API 文档指出此相机型号支持设置 Flash 模式,这是有道理的,因为我没有收到 501(未实现)错误。
谢谢。
【问题讨论】: