2018-03-25 13:26:51 +08:00
|
|
|
package cn.keking.service.impl;
|
|
|
|
|
|
2019-05-16 17:46:08 +08:00
|
|
|
import cn.keking.model.FileAttribute;
|
2018-03-25 13:26:51 +08:00
|
|
|
import cn.keking.service.FilePreview;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.ui.Model;
|
|
|
|
|
/**
|
|
|
|
|
* @author : kl
|
|
|
|
|
* @authorboke : kailing.pub
|
|
|
|
|
* @create : 2018-03-25 上午11:58
|
|
|
|
|
* @description:
|
|
|
|
|
**/
|
|
|
|
|
@Service
|
|
|
|
|
public class MediaFilePreviewImpl implements FilePreview {
|
|
|
|
|
|
|
|
|
|
@Override
|
2019-06-17 14:21:16 +08:00
|
|
|
public String filePreviewHandle(String url, Model model, FileAttribute fileAttribute) {
|
2018-03-25 13:26:51 +08:00
|
|
|
model.addAttribute("mediaUrl", url);
|
2019-05-16 17:46:08 +08:00
|
|
|
String suffix=fileAttribute.getSuffix();
|
|
|
|
|
if ("flv".equalsIgnoreCase(suffix)) {
|
|
|
|
|
return "flv";
|
|
|
|
|
}
|
2018-03-25 13:26:51 +08:00
|
|
|
return "media";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|