1、通过视频id获取单个视频的全部打点信息
2、接口URL中的{userid}为点播账号userid,具体参考菜单【使用须知】->【获取密钥】
3、接口URL中的{vid}为视频id
4、接口支持https协议
http://api.polyv.net/v2/video/{userid}/keyframe/{vid}
http://api.polyv.net/v2/video/1b448be323/keyframe/1b448be323b8d9b9489dcd7e8e09f087_1?vid=1b448be323b8d9b9489dcd7e8e09f087_1&sign=9FD6BA6486D1655C1D1A27C436F835C43BEB8406&userid=1b448be323&ptime=1617174767293
强烈建议您使用点播Java SDK完成API的功能对接,点播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
private static final Logger log = LoggerFactory.getLogger(VodChapterMakerTest.class);
/**
*查询打点信息
* @throws Exception
* @throws NoSuchAlgorithmException
*/
@Test
public void testGetChapterMaker() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String secretKey = super.secretKey;
String userId = super.userId;
String ptime = String.valueOf(System.currentTimeMillis());
//业务参数
String vid = "1b448be323b8d9b9489dcd7e8e09f087_1";
String url = String.format("http://api.polyv.net/v2/video/%s/keyframe/%s",userId,vid);
Map<String, String> requestMap = new HashMap<>();
requestMap.put("userid", userId);
requestMap.put("ptime", ptime);
requestMap.put("vid", vid);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.get(url, requestMap);
log.debug("测试查询打点信息,{}", response);
//do somethings
}
{
"code": 200,
"status": "success",
"message": "success",
"data": {
"duration": "00:02:19",
"keyframeList": [
{
"seconds": 10,
"keyContent": "测试打点10s"
},
{
"seconds": 20,
"keyContent": "测试打点20s"
}
]
}
}
{
"code": 400,
"status": "error",
"message": "the sign is not right.",
"data": ""
}