|
@@ -113,8 +113,9 @@ public class CloudVideoProcessUtil {
|
|
|
|
|
|
/**
|
|
|
* 查询数据万象任务状态
|
|
|
+ * @return
|
|
|
*/
|
|
|
- public static Map<String,Object> getMediaJobsResponse(String jobId){
|
|
|
+ public static Map getMediaJobsResponse(String jobId){
|
|
|
String auth =generateAuth(SECRET_ID,SECRET_KEY,"/jobs/"+jobId,HttpMethodName.GET);
|
|
|
if(auth.isEmpty()){
|
|
|
logger.error("腾讯云Authorization获取失败");
|
|
@@ -176,8 +177,10 @@ public class CloudVideoProcessUtil {
|
|
|
Map<String,Object> mapResp= XmlToMapUtil.multilayerXmlToMap(response);
|
|
|
Map JobsDetail= (Map)((Map)mapResp.get("Response")).get("JobsDetail");
|
|
|
if(JobsDetail.get("Code").equals("Success")){
|
|
|
- result.put("firstFrameUrl",CosConstant.URL_COS_ADDRESS+outputPath.replace("${Number}","0"));
|
|
|
- result.put("frameUrl",CosConstant.URL_COS_ADDRESS+outputPath.replace("${Number}.jpg",""));
|
|
|
+ Map jobStatusMap=getMediaJobsResponse(JobsDetail.get("JobId").toString());
|
|
|
+ if(jobStatusMap.get("State").equals("Success")){
|
|
|
+ result=getFrameUrl(outputPath);
|
|
|
+ }
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
@@ -221,4 +224,11 @@ public class CloudVideoProcessUtil {
|
|
|
expiredTime
|
|
|
);
|
|
|
}
|
|
|
+ private static Map<String,Object> getFrameUrl(String outputPath){
|
|
|
+ Map<String,Object> result=new HashMap<>();
|
|
|
+ for(int i=0;i<15;i++){
|
|
|
+ result.put(""+i+"",CosConstant.URL_COS_ADDRESS+outputPath.replace("${Number}",""+i+""));
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|