Query Channel Playback Settings
To query the playback switch individually, you can use the legacy API at Query Channel Playback Switch
API Description
1、查询频道回放设置
2、接口支持https协议
API URL
https://api.polyv.net/live/v3/channel/playback/get-setting
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 never be saved or used directly on the client side. All APIs must be called through your own server to relay requests to the POLYV server and retrieve response data. See Signature Generation Rules |
| channelId | true | String | Channel ID |
Example
http://api.polyv.net/live/v3/channel/playback/get-setting?appId=frlr1zazn3&sign=9DC1D9A3AAD34E0DD5C3B3154F1A6F5D&channelId=3187786×tamp=1655964947987
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code, 200 for success, non-200 for failure See Global Error Description |
| status | String | Response status text |
| message | String | Response description, provides error details when code is 400 or 500 |
| data | Object | Returns channel playback settings on success See Data Parameter Description |
Data Parameter Description
| Parameter | Type | Description |
|---|---|---|
| channelId | String | Channel ID |
| type | String | Playback type single: Single video playback list: List playback |
| playbackEnabled | String | Playback switch Y: Enabled N: Disabled |
| origin | String | Playback video source record: Recording file playback: Playback list vod: VOD list |
| videoId | String | Playback video ID |
| videoName | String | Playback video name |
| sectionEnabled | String | Playback setting, chapter switch Y: Enabled N: Disabled |
| globalSettingEnabled | String | Apply global settings Y: Yes N: No |
| crontabType | String | Scheduled playback type timedOpen: Scheduled open, timedClosed: Scheduled close, period: Open during time period, custom: Custom, disable: Disabled |
| startTime | Long | Playback start time, 13-digit millisecond timestamp |
| endTime | Long | Playback end time, 13-digit millisecond timestamp |
| playbackMultiplierEnabled | String | Playback speed multiplier switch Y: Enabled N: Disabled |
| playbackProgressBarEnabled | String | Progress bar switch Y: Enabled N: Disabled |
| playbackProgressBarOperationType | String | Progress bar operation mode drag: Drag, prohibitDrag: Drag prohibited, dragHistoryOnly: Drag only watched content |
| showPlayButtonEnabled | String | Show play button switch Y: Enabled N: Disabled |
| customOpenDuration | Long | Scheduled playback: Custom time, effective when crontType is custom |
| productPlaybackEnabled | String | Product library switch Y: Enabled N: Disabled. When enabled, viewers will see the product list and pushed products during playback, reading the latest backend product data. |
| chatPlaybackEnabled | String | Chat interaction replay switch Y: Enabled N: Disabled |
| questionnairePlaybackEnabled | String | Questionnaire interaction replay switch Y: Enabled N: Disabled |
| qaPlaybackEnabled | String | Quiz card interaction replay switch Y: Enabled N: Disabled |
| cardPushPlaybackEnabled | String | Card push interaction replay switch Y: Enabled N: Disabled |
| checkInPlaybackEnabled | String | Check-in interaction replay switch Y: Enabled N: Disabled |
Java Request Example
For quick integration of basic code, please 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 in the downloaded file.
It is strongly recommended to use the Live Java SDK for API integration. The Live Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pools.
private static final Logger log = LoggerFactory.getLogger(ChannelPlayBackTest.class);
/**
* 查询频道回放设置
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void testGetPlaybackSetting() 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/playback/get-setting";
String channelId = "3187786";
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 descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"message": "",
"data": {
"channelId": 3187786,
"type": "single",
"origin": "record",
"videoId": null,
"playbackEnabled": "Y",
"videoName": null,
"sectionEnabled": "Y",
"globalSettingEnabled": "N",
"chatPlaybackEnabled": "N",
"crontabType":"period",
"startTime": 1694102400000,
"endTime": 1695398400000,
"productPlaybackEnabled": null,
"customOpenDuration": 18,
"playbackMultiplierEnabled": "Y",
"playbackProgressBarEnabled": "Y",
"playbackProgressBarOperationType": "drag",
"showPlayButtonEnabled": "Y",
"questionnairePlaybackEnabled": "N",
"qaPlaybackEnabled": "N",
"cardPushPlaybackEnabled": "N",
"checkInPlaybackEnabled": "N"
}
}
Error Example
Parameter Error
{
"code": 400,
"status": "error",
"message": "param validate error",
"data": 400
}
Missing appId
{
"code": 400,
"status": "error",
"message": "appId is required.",
"data": ""
}
Incorrect appId
{
"code": 400,
"status": "error",
"message": "application not found.",
"data": ""
}
Timestamp Error
{
"code": 400,
"status": "error",
"message": "invalid timestamp.",
"data": ""
}
Signature Error
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
