|
|
@@ -340,7 +340,6 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { |
|
|
|
speakVideo.setVideoHyStatus(EnumVideoStatus.success.getCode()); |
|
|
|
speakVideo.setVideoMsg("超分视频生成成功"); |
|
|
|
speakVideo.setVideoPath(result.getUrl()); |
|
|
|
speakVideo.setIsHy(EnumYesOrNo.YES.getCode()); |
|
|
|
this.updateById(speakVideo); |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
@@ -373,23 +372,36 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { |
|
|
|
|
|
|
|
AtomicInteger integer = new AtomicInteger(30); |
|
|
|
while (true){ |
|
|
|
String progress = videoFactory.getExcutor(videoType).getVedioUploadProgress(result.getVideoId()); |
|
|
|
try { |
|
|
|
String progress = videoFactory.getExcutor(videoType).getVedioUploadProgress(result.getVideoId()); |
|
|
|
Thread.sleep(1000); |
|
|
|
} catch (InterruptedException e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
if (progress.equals("complete")) { |
|
|
|
VideUploadResult videoDetail = videoFactory.getExcutor(videoType).getVideoDetailWithCache(result.getVideoId()); |
|
|
|
if (videoDetail.isSuccess() |
|
|
|
&& StringUtils.isNotBlank(videoDetail.getDuration()) |
|
|
|
&& !"0.0".equals(videoDetail.getDuration())) { |
|
|
|
mouldVideo.setCoverImg(videoDetail.getCoverURL()); |
|
|
|
mouldVideo.setVideoPlayUrl(videoDetail.getVideoUrl()); |
|
|
|
mouldVideo.setVideoTime(videoDetail.getDuration()); |
|
|
|
mouldVideo.setVideoSize(videoDetail.getSize()); |
|
|
|
mouldVideo.setIsHy(EnumYesOrNo.YES.getCode()); |
|
|
|
mouldVideo.setVideoHyStatus(EnumVideoStatus.upload_success.getCode()); |
|
|
|
this.updateById(mouldVideo); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (progress.equals("complete")) { |
|
|
|
mouldVideo.setVideoHyStatus(EnumVideoStatus.upload_success.getCode()); |
|
|
|
this.updateById(mouldVideo); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (integer.getAndDecrement() <= 0){ |
|
|
|
if (integer.getAndDecrement() <= 0){ |
|
|
|
mouldVideo.setVideoHyStatus(EnumVideoStatus.fail.getCode()); |
|
|
|
mouldVideo.setVideoMsg("视频上传失败,点击“编辑”重试"); |
|
|
|
this.updateById(mouldVideo); |
|
|
|
break; |
|
|
|
} |
|
|
|
} catch (InterruptedException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
mouldVideo.setVideoHyStatus(EnumVideoStatus.fail.getCode()); |
|
|
|
mouldVideo.setVideoMsg("视频上传失败,点击“编辑”重试"); |
|
|
|
this.updateById(mouldVideo); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|