Polyv Help Center

Help Center

Set Channel Remastered Courseware Configuration

Updated: 2023-06-09 09:08:29

API Description

1、设置频道重制课件配置信息
2、接口支持https协议

API URL

http://api.polyv.net/live/v3/channel/pptRecord/setting

Online API Call

Request Method

POST

API Constraints

  1. The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details

  2. The picture-in-picture video layout requires the account to have this feature enabled.

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 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]
channelId true String Channel ID
globalSettingEnabled true String Whether to use global settings
Y: Yes
N: No
type true Integer Video layout mode
0: Three-screen
1: Document only
2: Picture-in-picture
videoRatio false Integer Camera aspect ratio, effective for new remastered version
0: Aspect ratio 16:9
1: Aspect ratio 4:3
brandImgFile false File Display image, effective for new remastered version. Supports jpg and png formats.
When camera aspect ratio is 16:9, size is 480X810
When camera aspect ratio is 4:3, size is 480X720
backgroundImgFile false File Background image, effective for old remastered version. Size is 1280X720. Supports jpg and png formats.

Example

http://api.polyv.net/live/v3/channel/pptRecord/setting

Form parameters:

videoRatio=0&brandImgFile=&appId=frlr1zazn3&sign=10546F6DDAE7B918E0124A53FA899E99&backgroundImgFile=http%3A%2F%2Fliveimages.videocc.net%2Fuploadimage%2F20201126%2FremakeCoursewareBg_1606386346554_8190198.jpg&globalSettingEnabled=N&type=1&channelId=2453970&timestamp=1629710058592

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 Object Returns the remastered courseware result set on success [See data field description]

data Field Description

Parameter Type Description
result Boolean Processing result, success or 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 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(ChannelOperateTest.class);
/**
 * 设置频道重制课件配置信息
 * @throws IOException
 * @throws NoSuchAlgorithmException
 */
@Test
public void pptSettingTest() 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/pptRecord/setting";
    String channelId = "2453970";
    String globalSettingEnabled = "N";
    String type = "1";
    String videoRatio = "0";
    String brandImgFile = "http://liveimages.videocc.net/uploadimage/20201126/remakeCoursewareBg_1606386346554_8190198.jpg";
    String backgroundImgFile = "http://liveimages.videocc.net/uploadimage/20201126/remakeCoursewareBg_1606386346554_8190198.jpg";
    
    //http 调用逻辑
    Map<String, String> requestMap = new HashMap<>();
    requestMap.put("appId", appId);
    requestMap.put("timestamp", timestamp);
    requestMap.put("channelId", channelId);
    requestMap.put("globalSettingEnabled", globalSettingEnabled);
    requestMap.put("type", type);
    requestMap.put("videoRatio", videoRatio);
    requestMap.put("brandImgFile", new File(brandImgFile));
    requestMap.put("backgroundImgFile", new File(backgroundImgFile));
    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": {
        "result": true
    }
}

Error Example

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