Content Protection (Screen Recording Prevention) Settings
Updated: 2026-01-28 18:57:09
Interface Description
1、通过频道号,修改播放器内容保护自定义url跑马灯开关,在开启时需提交url参数
2、接口支持https协议
For details, please refer to Custom URL Marquee
Interface URL
http://api.polyv.net/live/v2/channelRestrict/{channelId}/set-diyurl-marquee
Request Method
POST
Interface Constraints
- The interface supports both HTTP and HTTPS. HTTPS is recommended to ensure interface security. Interface calls are subject to 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 within 3 minutes |
| sign | true | String | Signature, a 32-character uppercase MD5 value. The appSecret used to generate the signature is critical for communication data security. It must not be stored or 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] |
| marqueeRestrict | true | String | Enter "Y" or "N". Custom URL content protection marquee toggle |
| url | true | String | Custom URL. Can be empty when the toggle is off; required when the toggle is on |
Example
http://api.polyv.net/live/v2/channelRestrict/2191569/set-diyurl-marquee
Form Parameters:
appId=frlr1zazn3&sign=58AA674D6BB40AC0BA49A3A7F99C18E8&marqueeRestrict=Y&url=http%3A%2F%2Fdemo.ipolyv.cn%2Fwfy%2Fmarquee.php×tamp=1621843205017
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 | String | Empty on failure; "Setting successful" on success |
Java Request Example
For quick integration of the base code, download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own project source code. 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(MarqueeTest.class);
/**
* 跑马灯设置
* @throws IOException
*/
@Test
public void testSetMarquee() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String channelId = "2191569";
String requestUrl = "http://api.polyv.net/live/v2/channelRestrict/"+channelId+"/set-diyurl-marquee";
String url = "http://demo.ipolyv.cn/wfy/marquee.php";
String marqueeRestrict = "Y";
//http 调用逻辑
Map<String,String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp",timestamp);
requestMap.put("url",url);
requestMap.put("marqueeRestrict",marqueeRestrict);
requestMap.put("sign",LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.postFormBody(requestUrl, requestMap);
log.info("测试跑马灯设置接口返回值:{}",response);
}
Response Example
For system-wide global error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"message": "",
"data": "设置成功"
}
Error Example
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}
