https://api.polyv.net/v2/video/upload-image-in-position
上传指定时间点的视频截图, 如果时间点对应的图片已存在,则会返回旧图片路径
POST
Content-Type:multipart/form-data;
上传成功
{
"code": 200,
"status": "success",
"message": "success",
"data": {
"vid": "a2dc4f2517dadf1bb312be765089e860_a"
"position": 10,
"imageUrl": "http://ab-upload.polyv.net/test/polyv.jpg",
"exists": 0
}
}
时间戳过期
{
"code": 400,
"status": "error",
"message": "ptime is too old",
"data": null
}
签名不正确
{
"code": 400,
"status": "error",
"message": "the sign is not right.",
"data": null
}
图片大小不能超过5M
{
"code": 400,
"status": "error",
"message": "ImageFile size can’t more than 5M",
"data": null
}
String url = "https://api.polyv.net/v2/video/upload-image-in-position";
String userid = "xxxxxxx";
String vid = "xxxxxxxxxxxxxxxxxxxx";
int position = 10;
String secretkey = "xxxxxxx";
long ptime = System.currentTimeMillis();
Map<String, String> params = new HashMap<>();
params.put("position", String.valueOf(position));
params.put("ptime", String.valueOf(ptime));
params.put("userid", userid);
params.put("vid", "xxx");
params.put("sign", getSign(params, secretkey));
String content = HttpClientUtil.getInstance().sendHttpPost(url, params);
System.out.println(content);