Skip to content

Commit e5a4c84

Browse files
committed
qvs LINK-2695 add controlGBRecord
1 parent d4ac0db commit e5a4c84

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

src/main/java/com/qiniu/qvs/DeviceManager.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,14 @@ public Response sendVoiceChatData(String url, String base64_pcm) throws QiniuEx
156156
StringMap params = new StringMap().putNotNull("base64_pcm", base64_pcm);
157157
return QvsResponse.post(url, params, client, auth);
158158
}
159+
160+
/*
161+
* 本地录像回放控制
162+
* streamId 流ID可以从查询本地录像列表接口queryGBRecordHistories获取的streamId
163+
*/
164+
public Response controlGBRecord(String namespaceId, String streamId, String command, String range, float scale) throws QiniuException {
165+
String url = String.format("%s/v1/namespaces/%s/streams/%s/playback/control", apiServer, namespaceId, streamId);
166+
StringMap params = new StringMap().putNotNull("command", command).put("range", range).put("scale", scale);
167+
return QvsResponse.post(url, params, client, auth);
168+
}
159169
}

src/test/java/test/com/qiniu/qvs/DeviceManagerTest.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,5 +201,39 @@ public void testQueryGBRecordHistories() {
201201
}
202202
}
203203
}
204+
205+
@Test
206+
@Tag("IntegrationTest")
207+
public void testQueryGBRecordHistories() {
208+
try {
209+
res = deviceManager.queryGBRecordHistories("qiniu", "31011500991180013385", "34020000001310000001",
210+
1665190800, 1665192093);
211+
assertNotNull(res);
212+
System.out.println(res.bodyString());
213+
} catch (QiniuException e) {
214+
e.printStackTrace();
215+
} finally {
216+
if (res != null) {
217+
res.close();
218+
}
219+
}
220+
}
221+
222+
@Test
223+
@Tag("IntegrationTest")
224+
public void controlGBRecord() {
225+
try {
226+
res = deviceManager.controlGBRecord("qiniu", "31011500991180013385_34020000001310000001_history_1665190800_1665192092", "play",
227+
"5", 2.0F);
228+
assertNotNull(res);
229+
System.out.println(res.bodyString());
230+
} catch (QiniuException e) {
231+
e.printStackTrace();
232+
} finally {
233+
if (res != null) {
234+
res.close();
235+
}
236+
}
237+
}
204238
*/
205239
}

0 commit comments

Comments
 (0)