|
|
@@ -153,20 +153,20 @@ public class FileUploadUtil {
|
|
|
String cacheVideoPath = copyFile(uploadDir, multipartFile);
|
|
|
filePathList.add(aliOSSUtil.uploadFile(multipartFile, prefix + videoFileName + "." + fileNameAndType.get("type")));
|
|
|
//缓存视频截图使用
|
|
|
-// File videoFile = new File(cacheVideoPath);
|
|
|
-// //获取视频某帧截图
|
|
|
-// log.info("FileUpload.uploadMoreFile 视频文件复制完毕, 获取第一秒图片 {}", videoFile.getName());
|
|
|
-// String videoPath = videoUtils.getImg(uploadDir + videoFile.getName());
|
|
|
-// log.info("FileUpload.uploadMoreFile 视频文件复制完毕, 图片位置 {}", videoPath);
|
|
|
-// if (!videoPath.isEmpty()) {
|
|
|
-// File videoImgFile = new File(videoPath);
|
|
|
-// Map<String, String> videoImg = FileUtil.getFileNameAndType(videoImgFile);
|
|
|
-// filePathList.add(aliOSSUtil.uploadFile(videoImgFile, prefix + videoFileName + "." + videoImg.get("type")));
|
|
|
-// videoImgFile.delete();
|
|
|
-// videoFile.delete();
|
|
|
-// } else {
|
|
|
-// throw new RuntimeException("视频截图失败");
|
|
|
-// }
|
|
|
+ File videoFile = new File(cacheVideoPath);
|
|
|
+ //获取视频某帧截图
|
|
|
+ log.info("FileUpload.uploadMoreFile 视频文件复制完毕, 获取第一秒图片 {}", videoFile.getName());
|
|
|
+ String videoPath = videoUtils.getImg(uploadDir + videoFile.getName());
|
|
|
+ log.info("FileUpload.uploadMoreFile 视频文件复制完毕, 图片位置 {}", videoPath);
|
|
|
+ if (!videoPath.isEmpty()) {
|
|
|
+ File videoImgFile = new File(videoPath);
|
|
|
+ Map<String, String> videoImg = FileUtil.getFileNameAndType(videoImgFile);
|
|
|
+ filePathList.add(aliOSSUtil.uploadFile(videoImgFile, prefix + videoFileName + "." + videoImg.get("type")));
|
|
|
+ videoImgFile.delete();
|
|
|
+ videoFile.delete();
|
|
|
+ } else {
|
|
|
+ throw new RuntimeException("视频截图失败");
|
|
|
+ }
|
|
|
} else if (voiceFileType.contains(fileNameAndType.get("type").toLowerCase())) {
|
|
|
uploadDir += "/voice";
|
|
|
prefix = "voice/";
|