Get Hard Disk Streaming (Pseudo-Live) Video List
Updated: 2023-12-27 15:43:51
API Description
1、获取硬盘推流(伪直播)视频列表
2、接口支持https协议
API URL
http://api.polyv.net/live/v3/channel/disk-video/list
Request Method
GET
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details
Request Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See Get Secret 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 stored or used directly on the client side. 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 |
| channelId | true | String | Channel ID |
| page | false | Integer | Current page number, default is 1 |
| limit | false | Integer | Page size, default is 10 |
Example
http://api.polyv.net/live/v3/channel/disk-video/list?appId=frlr1zazn3&sign=2E8DE3C2E5D62468917CF3A9B2DBC3D6&channelId=3889955×tamp=1681983834988
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code, 200 for success, non-200 for failure See Global Error Codes |
| status | String | Response status text |
| message | String | Response description, provides error details when code is 400 or 500 |
| data | String | Returned data See Data Parameter Description |
Data Parameter Description
| Parameter | Type | Description |
|---|---|---|
| pageSize | Integer | Number of items per page |
| pageNumber | Integer | Current page number |
| totalItems | Integer | Total number of items |
| contents | Array | List of channel details See Contents Parameter Description |
Content Parameter Description
| Parameter | Type | Description |
|---|---|---|
| videoId | String | Live system videoId |
| videoPoolId | String | VOD system videoPoolId |
| userId | String | Live system userId |
| channelId | Integer | Channel ID |
| title | String | Pseudo-live video title |
| firstImage | String | Pseudo-live thumbnail, requires domain concatenation to use |
| duration | String | Video duration, e.g., 00:17:36 |
| startTime | Long | Pseudo-live start time, 13-digit timestamp |
| endTime | Long | Pseudo-live end time, 13-digit timestamp |
| createdTime | Long | Record creation time |
| lastModified | Long | Record last modification time |
| url | String | Pseudo-live MP4 URL |
| streamStatus | String | Pseudo-live stream status: waiting-not live, live-streaming, end-finished |
| langType | String | Language: CN-Chinese, EN-English (available when channel enables dual-stream live streaming for English pseudo-live) |
Java Request Example
For quick integration of basic code, download the relevant dependency source code. Click here to download source code. After downloading, add it to your own source project. The test cases include HttpUtil.java and LiveSignUtil.java in the downloaded file.
It is strongly recommended to use the Live Java SDK for API integration. The Live Java SDK provides unified packaging and optimization for API call logic, exception handling, data signing, and HTTP request thread pooling.
private static final Logger log = LoggerFactory.getLogger(ChannelStateTest.class);
/**
* 获取硬盘推流(伪直播)视频列表
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void testListDiskVideo() 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/v3/channel/disk-video/list";
String channelId = "3889955";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("channelId", channelId);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.info("测试获取硬盘推流(伪直播)视频列表,返回值:{}", response);
//do somethings
}
Response Example
For global error codes, see Global Error Codes
Success Example
{
"code": 200,
"status": "success",
"message": "",
"data": {
"pageSize": 10,
"pageNumber": 1,
"totalItems": 1,
"contents": [
{
"videoId": "gjzwgmer37",
"videoPoolId": "1b448be323e0bb0564cdd816ce4fac61",
"userId": "1b448be323",
"channelId": 3889955,
"title": "2-1 认识对象",
"firstImage": "1b448be323/1/1b448be323e0bb0564cdd816ce4fac61_0.jpg",
"duration": "00:17:36",
"status": "N",
"startTime": 1681373864000,
"endTime": 1681374920000,
"createdTime": 1681373802000,
"lastModified": 1681373865000,
"url": "http://mpv.videocc.net/1b448be323/1/1b448be323e0bb0564cdd816ce4fac61_1.mp4",
"localFileName": "/data/diskvideo/202304/gjzwgmer37.mp4",
"processId": 27944,
"streamStatus": "end",
"pushIp": "172.18.148.58",
"langType": "CN",
"source": "VideoPool"
}
],
"limit": 1,
"endRow": 1,
"nextPageNumber": 1,
"totalPages": 1,
"startRow": 1,
"firstPage": true,
"lastPage": true,
"prePageNumber": 1,
"offset": 0
}
}
Error Example
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}
