|
@@ -177,9 +177,22 @@ 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")){
|
|
|
- Map jobStatusMap=getMediaJobsResponse(JobsDetail.get("JobId").toString());
|
|
|
+ Map jobStatusMap=null;
|
|
|
+ for(int i=0;i<10;i++){
|
|
|
+ try {
|
|
|
+ Thread.sleep(1000);
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ logger.error(e.getMessage());
|
|
|
+ }
|
|
|
+ jobStatusMap=getMediaJobsResponse(JobsDetail.get("JobId").toString());
|
|
|
+ if(jobStatusMap.get("State").equals("Success")){
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
if(jobStatusMap.get("State").equals("Success")){
|
|
|
result=getFrameUrl(outputPath);
|
|
|
+ }else {
|
|
|
+ result=getErrorUrl();
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
@@ -231,4 +244,10 @@ public class CloudVideoProcessUtil {
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+ private static Map<String,Object> getErrorUrl(){
|
|
|
+ Map<String,Object> result=new HashMap<>();
|
|
|
+ result.put("0",CosConstant.URL_COS_ADDRESS+"error.jpg");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|