支持flv视频预览

This commit is contained in:
陈精华
2019-05-16 17:46:08 +08:00
committed by kl
parent 3f40b60c64
commit 41d9015023
3 changed files with 43 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
package cn.keking.service.impl;
import cn.keking.model.FileAttribute;
import cn.keking.service.FilePreview;
import cn.keking.utils.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -20,6 +21,11 @@ public class MediaFilePreviewImpl implements FilePreview {
@Override
public String filePreviewHandle(String url, Model model) {
model.addAttribute("mediaUrl", url);
FileAttribute fileAttribute=fileUtils.getFileAttribute(url);
String suffix=fileAttribute.getSuffix();
if ("flv".equalsIgnoreCase(suffix)) {
return "flv";
}
return "media";
}