Batch Query Single Channel Playback Information
Updated: 2022-09-02 18:08:07
Interface Description
1、根据多个频道号查询每个频道设置的回放视频信息(仅支持非直播暂存的单个视频的回放查询)
2、接口支持https协议
Interface URL
http://api.polyv.net/live/v4/channel/play-back/get
Request Method
GET
Interface Constraints
The interface supports both HTTP and HTTPS. HTTPS is recommended to ensure interface security. Interface calls have frequency limits. See details
Only supports querying playback information for a single video that is not a live stream temporary file; otherwise, the returned data will be null.
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See details for obtaining key |
| timestamp | true | Long | Current 13-digit millisecond timestamp, valid for 3 minutes |
| sign | true | String | Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must not be saved or used directly on the client. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. See signature generation rules |
| channelIds | true | String | List of channel IDs, separated by commas |
Example
http://api.polyv.net/live/v4/channel/play-back/get?appId=frlr1zazn3&sign=5CE29DB9BDF1C24F85B096C38B9156B8&channelIds=1965681%2C2722361×tamp=1639717803069
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Status code, same as HTTP status code, used to determine the basic response status |
| status | String | Response result, determined by the business. Returns success on success, error on failure |
| success | Boolean | Whether the response was successful |
| requestId | String | Request ID, a unique UUID generated for each request. Only used for troubleshooting and debugging, should not be tied to business logic |
| data | Object | Channel response object See data parameter description |
| error | Object | Error information See error parameter description |
Error Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Error code, used to determine the specific error cause |
| desc | String | Error description, corresponding to error.code |
Data Parameter Description
| Parameter | Type | Description |
|---|---|---|
| channelId | Integer | Channel ID |
| vid | String | VOD system VID (commonly used field) |
| videoId | String | ID generated by the live streaming system (not commonly used, playback video in the video library) |
| videoPoolId | String | VOD video videoPoolId (not commonly used) |
| videoName | String | Video name |
| firstImg | String | Video thumbnail |
| duration | String | Video duration, e.g., 05:15:01 |
Java Request Example
For quick integration of the basic code, download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own source code project. The test cases include HttpUtil.java and LiveSignUtil.java, both contained in the downloaded file.
/**
* 批量查询频道单个回放信息
* @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
}
Response Example
For global system error descriptions, see Global Error Description
Success Example
{
"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
}
Error Example
{
"code": 400,
"status": "error",
"requestId": "4081dbac03e6441e8bdd301d8feee5a2.124.16360831818611581",
"error": {
"code": 20001,
"desc": "application not found."
},
"success": false
}
