동영상 캡쳐 수정(서버에 등록된 동영상 캡쳐)
parent
8e17ad60b9
commit
5a0674464b
@ -1,16 +1,55 @@
|
||||
package cokr.xit.fims.sprt.web;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.assertj.core.util.Arrays;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
public class Sprt03Controller {
|
||||
import cokr.xit.base.file.service.FileQuery;
|
||||
import cokr.xit.base.file.service.FileService;
|
||||
import cokr.xit.base.web.ApplicationController;
|
||||
import cokr.xit.foundation.data.DataObject;
|
||||
|
||||
public class Sprt03Controller extends ApplicationController {
|
||||
|
||||
@Resource(name="fileService")
|
||||
FileService fileService;
|
||||
|
||||
public String VIDEO_INF_TYPE = "190";
|
||||
public String[] VIDEO_MIME_TYPE = {
|
||||
"video/mp4", "video/webm", "video/ogg"
|
||||
};
|
||||
|
||||
/** 동영상 재생 메인화면을 연다.
|
||||
* @return fims/sprt/sprt03010-main
|
||||
*/
|
||||
public ModelAndView videoMain(String openerPageName) {
|
||||
public ModelAndView videoMain(String openerPageName, String crdnId) {
|
||||
ModelAndView mav = new ModelAndView();
|
||||
|
||||
mav.setViewName("fims/sprt/sprt03010-main");
|
||||
mav.addObject("openerPageName", openerPageName);
|
||||
|
||||
if(crdnId != null && !crdnId.equals("")) {
|
||||
mav.addObject("crdnId", crdnId);
|
||||
|
||||
FileQuery fileQuery = new FileQuery();
|
||||
fileQuery.setInfoKeys(crdnId);
|
||||
fileQuery.setInfoType(VIDEO_INF_TYPE);
|
||||
List<DataObject> fileList = fileService.getFileList(fileQuery);
|
||||
if(fileList != null && !fileList.isEmpty()) {
|
||||
for(int i=0; i < fileList.size() ;i++) {
|
||||
DataObject file = fileList.get(i);
|
||||
String mimeType = file.string("MIME_TYPE");
|
||||
if(Arrays.asList(VIDEO_MIME_TYPE).contains(mimeType)){
|
||||
mav.addObject("fileInfo", toJson(file));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return mav;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue