Polyv Help Center

Help Center

Query Playback Settings for Multiple Channels

Updated: 2025-02-18 16:20:20

API Description

1、查询多个频道回放设置
2、接口支持https协议

API URL

http://api.polyv.net/live/v4/channel/playback/list

Online API Call

Request Method

GET

API Constraints

  1. The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls are rate-limited. See details

Request Parameters

Parameter Required Type Description
appId true String Account appId See details on obtaining keys
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
channelIds true String Comma-separated channel IDs, e.g., 10000,100001. Maximum 100 channels.

Example

http://api.polyv.net/live/v4/channel/playback/list?appId=frlr1zazn3&sign=DA99F02427F3DF709AE0BE4007501DC4&channelIds=3385357%2C1965681&timestamp=1663859723019

Response Parameters

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 request was successful
requestId String Request ID, a unique UUID generated for each request. Only for troubleshooting and debugging, not for business logic
error Object Error information when status code is not 200 See Error field description
data Array Video list See data field description

Error Parameters

Parameter Type Description
code Integer Error code, used to identify the specific error
desc String Error description, corresponding to error.code

data Parameters

Parameter Type Description
channelId Integer Channel ID
playBackEnabled String Playback toggle
Y: Enabled
N: Disabled
origin String Playback source
record: Temporary storage
playback: Playback list
vod: VOD list
type String Playback mode
single: Single video playback
list: List playback
videoList Array Video list. Returns only one video for single mode, top 10 videos for list mode. Returns the video list even when playback is disabled See videoList field description
globalSettingEnabled String Whether global settings are enabled
Y: Enabled
N: Disabled

videoList Parameters

Parameter Type Description
videoId String ID generated by the live streaming system (populated when the playback source is the playback list or VOD list)
videoPoolId String VOD video videoPoolId (populated when the playback source is the playback list or VOD list)
fileId String Temporary file ID before playback video transfer (populated when the playback source is temporary storage)
duration String Video duration, format: HH:mm:ss
name String Video name
watchUrl String Watch URL for the playback video. Note: This field is only populated when the "playback source" is not "temporary storage"

Java Request Example

For quick integration of the basic code, please download the relevant dependency source code. Click here to download the 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 a unified wrapper and optimization for API call logic, exception handling, data signing, and HTTP request thread pools.

private static final Logger log = LoggerFactory.getLogger(getClass());
/**
 * 查询多个频道回放设置视频列表
 * @throws IOException
 * @throws NoSuchAlgorithmException
 */
@Test
public void getChannelPlaybackListTest() throws IOException, NoSuchAlgorithmException {
    //公共参数,填写自己的实际参数
    String appId = super.appId;
    String appSecret = super.appSecret;
    String timestamp = String.valueOf(System.currentTimeMillis());
    
    //业务参数
    String url = "http://api.polyv.net/live/v4/channel/playback/list";
    String channelIds = "3385357,1965681";
    
    //http 调用逻辑
    Map<String, String> requestMap = new HashMap<>();
    requestMap.put("appId", appId);
    requestMap.put("timestamp", timestamp);
    requestMap.put("channelIds", channelIds);
    
    requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
    
    String response = HttpUtil.get(url, requestMap);
    
    log.info("测试查询多个频道回放设置视频列表成功:{}", response);
    //do somethings
    
}

Response Example

For system-wide error descriptions, see Global Error Description

Success Example

{
    "code": 200,
    "status": "success",
    "requestId": "4a3bcfe6010942ab801d53e76db05227.68.16638597246720685",
    "data": [
        {
            "channelId": 1965681,
            "playBackEnabled": "Y",
            "origin": "playback",
            "type": "single",
            "videoList": [
                {
                    "videoId": "1dcabe17a4",
                    "videoPoolId": "1b448be32347e1dfeb92fbf92849fda7",
                    "duration": "00:02:30",
                    "name": "Junit测试(勿删)",
                    "fileId": null
                }
            ],
            "globalSettingEnabled": "N"
        },
        {
            "channelId": 3385357,
            "playBackEnabled": "Y",
            "origin": "record",
            "type": "single",
            "videoList": [],
            "globalSettingEnabled": "Y"
        }
    ],
    "success": true
}

Error Example

{
    "code": 400,
    "status": "error",
    "requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
    "error": {
        "code": 20001,
        "desc": "application not found."
    },
    "success": false
}
联系客服,在线咨询