Modify Channel Playback Settings
To modify the playback switch individually, you can use the legacy API. API endpoint: Modify Channel Playback Switch
API Description
1、修改频道回放设置
2、接口支持https协议
API URL
http://api.polyv.net/live/v3/channel/playback/set-setting
<a href="/req.html?api=http://api.polyv.net/live/v3/channel/playback/set-setting"" target="_blank">Online API Call
Request Method
POST
API Constraints
The API supports both HTTP and HTTPS. HTTPS is recommended to ensure security. API calls have frequency limits. See details
When the request parameter
typeissingle,origincan be set torecord,playback, orvod. Whenoriginis set toplaybackorvod,videoIdmust also be provided.When the request parameter
typeislist,origincan be set toplaybackorvod.
Request Parameter Description
| Parameter Name | 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-digit uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must never be used directly on the client side. All APIs must be called through your own server to relay requests to the POLYV server for response data. See: Signature Generation Rules |
| channelId | true | String | Channel ID |
| globalSettingEnabled | false | String | Whether to use global settings. Default is N (not effective for new backend channel settings). Y: Yes N: No |
| crontabType | false | String | Scheduled playback type: timedOpen - timed open, timedClosed - timed close, period - open within a time period, custom - custom, disable - disabled |
| startTime | false | Long | Time to enable playback, 13-digit timestamp |
| endTime | false | Long | Time to disable playback, 13-digit timestamp |
| playbackEnabled | false | String | Playback switch status. Default is N Y: Enable N: Disable |
| type | false | String | Playback methodsingle: Single playbacklist: List playback |
| origin | false | String | Playback sourcerecord: Temporary storageplayback: Playback listvod: VOD listmaterial: Material library |
| videoId | false | String | Video ID in the live streaming system can be obtained via Query Video Library List, e.g., 73801f70c8. Note: This is not the VOD vid. |
| sectionEnabled | false | String | Chapter switch Y: Enable N: Disable |
| playbackMultiplierEnabled | false | String | Speed playback switch Y: Enable N: Disable |
| playbackProgressBarEnabled | false | String | Progress bar switch Y: Enable N: Disable |
| playbackProgressBarOperationType | false | String | Progress bar operation modedrag: Drag, prohibitDrag: Prohibit drag, dragHistoryOnly: Only drag watched content |
| showPlayButtonEnabled | false | String | Show play button switch Y: Enable N: Disable |
| productPlaybackEnabled | false | String | Product library switch Y: Enable N: Disable |
| customOpenDuration | false | Long | Scheduled playback: Custom time. Effective when crontabType is custom. |
| chatPlaybackEnabled | false | String | Chat interaction replay switch Y: Enable N: Disable |
| productPlaybackEnabled | false | String | Product library interaction replay switch Y: Enable N: Disable |
| questionnairePlaybackEnabled | false | String | Questionnaire interaction replay switch Y: Enable N: Disable |
| qaPlaybackEnabled | false | String | Quiz card interaction replay switch Y: Enable N: Disable |
| cardPushPlaybackEnabled | false | String | Card push interaction replay switch Y: Enable N: Disable |
| checkInPlaybackEnabled | false | String | Check-in interaction replay switch Y: Enable N: Disable |
Example
http://api.polyv.net/live/v3/channel/playback/set-setting
Form Parameters:
appId=frlr1zazn3&origin=playback&sign=01556AABE64ED5C285FF5378392FCD8C&globalSettingEnabled=N&videoId=73801f70c8&type=list&channelId=2191532×tamp=1621840770330&playbackEnabled=Y
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code. 200 indicates success, non-200 indicates failure. See: Global Error Description |
| status | String | Response status text |
| message | String | Response description. When code is 400 or 500, provides additional error details. |
| data | Boolean | Returns true on successful request, returns empty on failure. |
Java Request Example
For quick integration of the base code, download the relevant dependency source code. Click to download 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 download 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 testSetRecordSetting() 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/set-setting";
String channelId = "2139283";
String globalSettingEnabled = "N";
String playbackEnabled = "Y";
String type = "single";
String origin = "playback";
String videoId = "73801f70c8";
String playbackMultiplierEnabled = "Y";
String playbackProgressBarEnabled = "Y";
String playbackProgressBarOperationType = "drag";
String showPlayButtonEnabled = "Y";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("channelId", channelId);
requestMap.put("globalSettingEnabled", globalSettingEnabled);
requestMap.put("playbackEnabled", playbackEnabled);
requestMap.put("type", type);
requestMap.put("origin", origin);
requestMap.put("videoId", videoId);
requestMap.put("playbackMultiplierEnabled", playbackMultiplierEnabled);
requestMap.put("playbackProgressBarEnabled", playbackProgressBarEnabled);
requestMap.put("playbackProgressBarOperationType", playbackProgressBarOperationType);
requestMap.put("showPlayButtonEnabled", showPlayButtonEnabled);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.postFormBody(url, requestMap);
log.info("测试修改频道回放设置,返回值:{}", response);
//do somethings
}
Response Example
For global system error descriptions, see Global Error Description
Success Example
{
"code":200,
"status":"success",
"message":"",
"data":true
}
Error Example
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}
