|
|
@@ -37,6 +37,8 @@ import lombok.extern.slf4j.Slf4j; |
|
|
|
@Slf4j |
|
|
|
public class AliyunVideoExcutor implements VideoExcutor { |
|
|
|
|
|
|
|
private String videoStatus = "Normal";//正常的视频状态 |
|
|
|
|
|
|
|
@Autowired |
|
|
|
AliyunVideoConfig config; |
|
|
|
|
|
|
@@ -142,10 +144,11 @@ public class AliyunVideoExcutor implements VideoExcutor { |
|
|
|
return videoDetail; |
|
|
|
}else{ |
|
|
|
VideUploadResult result = getVideoDetailFromApi(videoId); |
|
|
|
if(StringUtils.isNotBlank(result.getCoverURL()) |
|
|
|
&& StringUtils.isNotBlank(result.getDuration()) |
|
|
|
&& !"0.0".equals(result.getDuration())){ |
|
|
|
if(this.videoStatus.equals(result.getStatus())){ |
|
|
|
UploadCacheHelper.cacheVideoDetail(redisTemplate, videoId,result); |
|
|
|
}else{ |
|
|
|
//还不能播放 |
|
|
|
result.setSuccess(false); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
@@ -162,6 +165,7 @@ public class AliyunVideoExcutor implements VideoExcutor { |
|
|
|
List<GetPlayInfoResponse.PlayInfo> playInfoList = response.getPlayInfoList(); |
|
|
|
//播放地址 |
|
|
|
for (GetPlayInfoResponse.PlayInfo playInfo : playInfoList) { |
|
|
|
result.setStatus(playInfo.getStatus()); |
|
|
|
result.setVideoUrl(playInfo.getPlayURL()); |
|
|
|
result.setHeight(playInfo.getHeight()); |
|
|
|
result.setWidth(playInfo.getWidth()); |
|
|
|