创建重制课件任务

接口URL

https://api.polyv.net/live/v3/channel/pptRecord/addRecordTask

接口说明

(接口调用有频率限制,详细请查看)

1、接口用于创建重制课件任务, 需等候任务队列执行完成,不是实时重制
2、接口支持https

返回结果支持格式

JSON

请求方式

POST

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 从API设置中获取,在直播系统登记的appId
timestamp long 13位当前毫秒级时间戳
sign string 签名值
channelId int 频道号
videoId string 回放视频id

响应成功JSON示例:

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": ""
}

响应字段说明

参数名 说明
code 状态码,成功为200,签名失败为403,参数错误为400,服务端错误为500
status 成功为success,错误时为error
message 成功为"",错误时为错误描述信息
data 响应数据

响应失败JSON示例:

参数错误

{
    "code": 400,
    "status": "error",
    "message": "param validate error",
    "data": ""
}

未输入appId

{
    "code": 400,
    "status": "error",
    "message": "appId is required.",
    "data": ""
}

appId不正确

{
    "code": 400,
    "status": "error",
    "message": "application not found.",
    "data": ""
}

时间戳错误

{
    "code": 400,
    "status": "error",
    "message": "invalid timestamp.",
    "data": ""
}

签名错误

{
    "code": 403,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}

非法频道号

{
    "code": 403,
    "status": "error",
    "message": "illegal channel id: %s",
    "data": ""
}

回放视频不存在

{
    "code": 400,
    "status": "error",
    "message": "playback video not exist",
    "data": ""
}

不能重制的视频,例如不是三分屏

{
    "code": 400,
    "status": "error",
    "message": "invalid playback video",
    "data": ""
}

回放时长限制,例如视频时长大于6个小时

{
    "code": 400,
    "status": "error",
    "message": "playback duration limited",
    "data": ""
}

视频已经重制过

{
    "code": 400,
    "status": "error",
    "message": "this ppt record task already exist",
    "data": ""
}

java请求示例

public void testAddRecordTask() {
        String url = "https://api.polyv.net/live/v3/channel/pptRecord/addRecordTask";
        // appId和加密串
        String appId = "xxxxxxx";
        String appSecret = "xxxxxxxxxxxxxxxxxx";
        String videoId = "abc";
        int channelId = 123;
        Map<String, String> params = new HashMap<>();
        params.put("videoId", videoId);
        params.put("channelId", String.valueOf(channelId));
        // 调用Polyv的工具类方法设置sign
        PolyvTool.setLiveSign(params, appId, appSecret);
        String content = HttpClientUtil.getInstance()
                .sendHttpPost(url, params);
        System.out.println(content);
}

签名规则及工具文件代码

https://dev.polyv.net/2020/liveproduct/l-api/rule/live-api-java-detail/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...