Modify Default Template Playback Settings
API Description
1、修改回放默认模板设置
2、接口支持https协议
API URL
http://api.polyv.net/live/v4/user/template/playback-setting/update
Request Method
POST
API Constraints
The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details
When the request parameter
typeissingle,origincan be set torecord.When the request parameter
typeislist,origincan be set toplaybackorvod.
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See details on obtaining keys |
| 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 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 |
| timestamp | true | String | Current 13-digit millisecond timestamp, valid for 3 minutes |
Request Body Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| playbackEnabled | false | String | Playback toggle Y: Enable N: Disable |
| type | false | String | Playback method on the viewing page single: Single video list: List playback |
| origin | false | String | Playback video source record: Temporary storage playback: Playback list vod: VOD list |
| sectionEnabled | false | String | Chapter toggle Y: Enable N: Disable |
| playbackMultiplierEnabled | false | String | Speed playback toggle Y: Enable N: Disable |
| playbackProgressBarEnabled | false | String | Progress bar toggle Y: Enable N: Disable |
| playbackProgressBarOperationType | false | String | Progress bar operation mode drag: Draggable, prohibitDrag: Drag prohibited, dragHistoryOnly: Only draggable for watched content |
| showPlayButtonEnabled | false | String | Show play button toggle Y: Enable N: Disable |
| chatPlaybackEnabled | false | String | Chat interaction replay toggle Y: Enable N: Disable |
| productPlaybackEnabled | false | String | Product library interaction replay toggle Y: Enable N: Disable |
| questionnairePlaybackEnabled | false | String | Questionnaire interaction replay toggle Y: Enable N: Disable |
| qaPlaybackEnabled | false | String | Quiz card interaction replay toggle Y: Enable N: Disable |
| cardPushPlaybackEnabled | false | String | Card push interaction replay toggle Y: Enable N: Disable |
| checkInPlaybackEnabled | false | String | Check-in interaction replay toggle Y: Enable N: Disable |
Example
http://api.polyv.net/live/v4/user/template/playback-setting/update?appId=frlr1zazn3&sign=9C73C7471CF969AD8AC042221C89551D×tamp=1677167340447
Request body JSON parameters:
{
"sectionEnabled": "N",
"chatPlaybackEnabled": "Y",
"origin": "vod",
"type": "list",
"playbackEnabled": "N",
"playbackMultiplierEnabled": "Y",
"playbackProgressBarEnabled": "N",
"playbackProgressBarOperationType": "drag",
"showPlayButtonEnabled": "N",
"productPlaybackEnabled": "Y",
"questionnairePlaybackEnabled": "Y",
"qaPlaybackEnabled": "Y",
"cardPushPlaybackEnabled": "Y",
"checkInPlaybackEnabled": "Y"
}
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Status code, same as HTTP status code, used to determine the basic response status |
| data | Object | Data for a successful response |
| error | Object | Error information when status code is not 200 See Error parameter description |
| requestId | String | Request ID, a unique UUID generated for each request, used only for troubleshooting and debugging, not for business logic |
| status | String | Response result, determined by business logic. Returns success on success, error on failure |
| success | Boolean | Whether the response was successful |
Error Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Error code, used to identify the specific error reason |
| desc | String | Error description, corresponding to error.code |
Java Request Example
For quick integration of basic code, download the relevant dependency source code. Click to download source code. After downloading, add it to your own source 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(getClass());
/**
* 修改回放默认模板设置
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void updatePlaybackSettingTemplateTest() 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/user/template/playback-setting/update";
String chatPlaybackEnabled = "Y";
String origin = "vod";
String playbackEnabled = "N";
String sectionEnabled = "N";
String type = "list";
String playbackMultiplierEnabled = "N";
String playbackProgressBarEnabled = "N";
String playbackProgressBarOperationType = "drag";
String showPlayButtonEnabled = "N";
String productPlaybackEnabled = "Y";
String questionnairePlaybackEnabled = "Y";
String qaPlaybackEnabled = "Y";
String cardPushPlaybackEnabled = "Y";
String checkInPlaybackEnabled = "Y";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
Map<String, Object> jsonMap = new HashMap<>();
jsonMap.put("chatPlaybackEnabled", chatPlaybackEnabled);
jsonMap.put("origin", origin);
jsonMap.put("playbackEnabled", playbackEnabled);
jsonMap.put("sectionEnabled", sectionEnabled);
jsonMap.put("type", type);
jsonMap.put("playbackMultiplierEnabled", playbackMultiplierEnabled);
jsonMap.put("playbackProgressBarEnabled", playbackProgressBarEnabled);
jsonMap.put("playbackProgressBarOperationType", playbackProgressBarOperationType);
jsonMap.put("showPlayButtonEnabled", showPlayButtonEnabled);
jsonMap.put("productPlaybackEnabled", productPlaybackEnabled);
jsonMap.put("questionnairePlaybackEnabled", questionnairePlaybackEnabled);
jsonMap.put("qaPlaybackEnabled", qaPlaybackEnabled);
jsonMap.put("cardPushPlaybackEnabled", cardPushPlaybackEnabled);
jsonMap.put("checkInPlaybackEnabled", checkInPlaybackEnabled);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
url = HttpUtil.appendUrl(url, requestMap);
String response = HttpUtil.postJsonBody(url, JSON.toJSONString(jsonMap), null);
log.info("测试修改回放默认模板设置成功:{}", response);
//do somethings
}
Response Example
For global system error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"requestId": "a5e9b1d15f544d7a9db6f038156a851d.71.16771673423081591",
"data": null,
"success": true
}
Error Example
{
"code": 400,
"status": "error",
"requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
"error": {
"code": 20001,
"desc": "application not found."
},
"success": false
}
