Polyv Help Center

Help Center

Set Channel Content Protection (Anti-Screen Recording Info)

Updated: 2026-01-28 18:44:46

Legacy API endpoint Marquee Settings (Legacy)

API Description

1、通过频道号,设置频道内容保护(防录屏信息)
2、接口支持https协议

API URL

http://api.polyv.net/live/v3/channel/anti/record/setting

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 have frequency limits. See details

Request Parameter Description

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 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
enable false String Content protection toggle, default is enabled
Y: Enable
N: Disable
antiRecordType true String Content protection method
marquee: Marquee
watermark: Watermark
modelType true String Content protection type. Setting a custom URL is invalid when using watermark mode.
fixed: Fixed value
nickname: Login username
diyurl: URL custom marquee
content true String For fixed value: the content to set
For URL custom: the website URL, must include http:// or https:// See Custom Marquee Reference
Can be omitted when content protection type is login username
fontSize true String Font size
When content protection method is marquee: set a numeric value, range 1-256
When content protection method is watermark:
small: Small
middle: Medium
large: Large
opacity false Integer Opacity, default is 80 if not provided, range 0-100
fontColor false String Marquee font color, color value, e.g., #FFFFFF
autoZoomEnabled false String Marquee custom scaling, default is disabled
Y: Enable
N: Disable
doubleEnabled false String Dual marquee, default is disabled
Y: Enable
N: Disable
showMode false String Marquee display mode, default is scrolling
roll: Scrolling
flicker: Flashing

Example

http://api.polyv.net/live/v3/channel/anti/record/setting

Form parameters:

doubleEnabled=N&autoZoomEnabled=Y&sign=5C3360AE6C5ED07D973D7E75DAF2646B&showMode=flicker&modelType=fixed&content=test&antiRecordType=marquee&appId=frlr1zazn3&fontSize=20&opacity=80&channelId=2453970&fontColor=%23FFF&timestamp=1629967807901

Response Parameter Description

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 String Empty on failure, "SUCCESS" on success

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 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(MarqueeTest.class);
/**
 * 设置频道内容保护(防录屏信息)
 * @throws IOException
 * @throws NoSuchAlgorithmException
 */
@Test
public void marqueeSettingTest() 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/anti/record/setting";
    String channelId = "2453970";
    String antiRecordType = "marquee";
    String modelType = "fixed";
    String content = "test";
    String opacity = "80";
    String fontSize = "20";
    String fontColor = "#FFF";
    String autoZoomEnabled = "Y";
    String doubleEnabled = "N";
    String showMode = "flicker";
    
    //http 调用逻辑
    Map<String, String> requestMap = new HashMap<>();
    requestMap.put("appId", appId);
    requestMap.put("timestamp", timestamp);
    requestMap.put("channelId", channelId);
    requestMap.put("antiRecordType", antiRecordType);
    requestMap.put("modelType", modelType);
    requestMap.put("content", content);
    requestMap.put("opacity", opacity);
    requestMap.put("fontSize", fontSize);
    requestMap.put("fontColor", fontColor);
    requestMap.put("autoZoomEnabled", autoZoomEnabled);
    requestMap.put("doubleEnabled", doubleEnabled);
    requestMap.put("showMode", showMode);
    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": "SUCCESS"
}

Error Example

{
    "code": 400,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}
联系客服,在线咨询