瀏覽代碼

修复 视频格式获取错误 不输出问题

gaoxiongzaq 2 年之前
父節點
當前提交
75061d843a
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      server/src/main/java/cn/keking/service/impl/MediaFilePreviewImpl.java

+ 2 - 2
server/src/main/java/cn/keking/service/impl/MediaFilePreviewImpl.java

@@ -38,7 +38,7 @@ public class MediaFilePreviewImpl implements FilePreview {
         String cacheName =  fileAttribute.getcacheName();
         String outFilePath = fileAttribute.getoutFilePath();
         boolean forceUpdatedCache=fileAttribute.forceUpdatedCache();
-        String type = fileAttribute.getSuffix();
+        FileType type = fileAttribute.getType();
         String[] mediaTypesConvert = FileType.MEDIA_TYPES_CONVERT;  //获取支持的转换格式
         boolean  mediaTypes = false;
         for(String temp : mediaTypesConvert){
@@ -59,7 +59,7 @@ public class MediaFilePreviewImpl implements FilePreview {
                     if(mediaTypes){
                         convertedUrl=convertToMp4(filePath,outFilePath);
                     }else {
-                        convertedUrl =outFilePath;  //其他协议的  不需要转换方式的文件 支持输出
+                        convertedUrl =outFilePath;  //其他协议的  不需要转换方式的文件 直接输出
                     }
                 } catch (Exception e) {
                     e.printStackTrace();