Polyv Help Center

Help Center

Modify Default Template Content Protection (Screen Recording Prevention) Settings

Updated: 2026-01-28 18:56:22

API Description

1、更新内容保护默认模板设置
2、接口支持https协议

API URL

http://api.polyv.net/live/v4/user/template/marquee/update

Online API Call

Request Method

POST

API Constraints

  1. The API supports both HTTP and HTTPS. HTTPS is recommended to ensure API security. API calls are subject to rate limits. See details

Request Parameter Description

Parameter Required Type Description
appId true String Account appId See 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 the customer's 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
enable true String Content protection toggle
Y: Enable
N: Disable
antiRecordType false String Content protection method, required when content protection is enabled
marquee: Scrolling text
watermark: Watermark
modelType false String Content protection type, required when content protection is enabled. Setting a custom URL is invalid for watermark mode.
fixed: Fixed
nickname: Username
diyurl: Custom URL, only valid for marquee mode
content false String Content when protection type is fixed
URL when using custom URL, must include http:// or https://
Not required when protection type is username. Required for fixed and custom URL types
opacity false Integer Marquee opacity, range 0-99
Watermark opacity, range 0-100
fontSize false String Font size
For marquee mode: numeric value, range 1-256
For watermark mode:
small: Small
middle: Medium
large: Large
fontColor false String Marquee font color, hex value, e.g., #FFFFFF
showMode false String Marquee display mode
roll: Scrolling
flicker: Flashing
doubleEnabled false String Dual marquee toggle
Y: Enable
N: Disable
autoZoomEnabled false String Custom zoom toggle
Y: Enable
N: Disable

Example

http://api.polyv.net/live/v4/user/template/marquee/update?appId=frlr1zazn3&sign=EC5A0EF79FAE452F1393A33B10AD6173&timestamp=1677201932605

Request body JSON parameters:

{
    "doubleEnabled": "N",
    "autoZoomEnabled": "Y",
    "enable": "Y",
    "fontSize": "20",
    "showMode": "flicker",
    "modelType": "fixed",
    "opacity": "80",
    "content": "测试跑马灯内容test",
    "fontColor": "#ff4d4f",
    "antiRecordType": "marquee"
}

Response Parameter Description

Parameter Type Description
code Integer Status code, same as HTTP status code, used to determine basic response status
data Object Data on 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, only for troubleshooting and debugging, should not be tied to 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 cause
desc String Error description, corresponds to error.code

Java Request Example

For quick integration of basic code, please 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 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(getClass());
/**
 * 更新内容保护默认模板设置
 * @throws IOException
 * @throws NoSuchAlgorithmException
 */
@Test
public void updateMarqueeTemplateTest() 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/marquee/update";
    String antiRecordType = "marquee";
    String autoZoomEnabled = "Y";
    String content = "测试跑马灯内容test";
    String doubleEnabled = "N";
    String enable = "Y";
    String fontColor = "#ff4d4f";
    String fontSize = "20";
    String modelType = "fixed";
    String opacity = "80";
    String showMode = "flicker";
    
    //http 调用逻辑
    Map<String, String> requestMap = new HashMap<>();
    requestMap.put("appId", appId);
    requestMap.put("timestamp", timestamp);
    
    Map<String, Object> jsonMap = new HashMap<>();
    jsonMap.put("antiRecordType", antiRecordType);
    jsonMap.put("autoZoomEnabled", autoZoomEnabled);
    jsonMap.put("content", content);
    jsonMap.put("doubleEnabled", doubleEnabled);
    jsonMap.put("enable", enable);
    jsonMap.put("fontColor", fontColor);
    jsonMap.put("fontSize", fontSize);
    jsonMap.put("modelType", modelType);
    jsonMap.put("opacity", opacity);
    jsonMap.put("showMode", showMode);
    
    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.67.16772019328880111",
    "data": null,
    "success": true
}

Error Example

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