1、根据多个频道号查询每个频道设置的回放视频信息(仅支持非直播暂存的单个视频的回放查询)
2、接口支持https协议
http://api.polyv.net/live/v4/channel/play-back/get
http://api.polyv.net/live/v4/channel/play-back/get?appId=frlr1zazn3&sign=5CE29DB9BDF1C24F85B096C38B9156B8&channelIds=1965681%2C2722361×tamp=1639717803069
/**
* 批量查询频道单个回放信息
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void testPlaybackVideoInfoList() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际
String appId = super.appId;
String appSecret = super.appSecret;
String userId = super.userId;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/live/v4/channel/play-back/get";
String categoryIds="340019,345134";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("channelIds", "1965681,2722361");
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.info("测试批量查询频道单个回放信息,返回值:{}", response);
//do somethings
}
{
"code": 200,
"status": "success",
"requestId": "f4b2f18c-f8f6-41f0-b0c8-9eef00af4fba",
"data": [
{
"channelId": 2722361,
"videoId": null,
"videoPoolId": null,
"videoName": null,
"firstImg": null,
"duration": null,
"vid": null
},
{
"channelId": 1965681,
"videoId": "8073e37567",
"videoPoolId": "1b448be323a9076c9941604ac1c667f9",
"videoName": "Junit测试(勿删)",
"firstImg": "//doc.polyv.net/images/default/blackboard.png",
"duration": "05:15:01",
"vid": "1b448be323a9076c9941604ac1c667f9_1"
}
],
"success": true
}
{
"code": 400,
"status": "error",
"requestId": "4081dbac03e6441e8bdd301d8feee5a2.124.16360831818611581",
"error": {
"code": 20001,
"desc": "application not found."
},
"success": false
}