| | |
| | | import java.io.File; |
| | | import java.util.Date; |
| | | |
| | | import com.obs.services.ObsClient; |
| | | import com.obs.services.model.ObsObject; |
| | | import com.qxueyou.scc.sys.utils.VideoUtil; |
| | | import org.apache.commons.io.FileUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | @Autowired |
| | | ICacheService cacheService; |
| | | |
| | | @Value("${scc.resRootPath}") |
| | | String resRootPath; |
| | | |
| | | @Override |
| | | public String add(String fileId, String name) { |
| | |
| | | TraceUtils.setCreateTrace(resVideo); |
| | | try { |
| | | resVideo.setFileId(fileId); |
| | | resVideo.setPlayTime((int) VideoUtil.getMp4Duration(resRootPath +"/"+ file.getPath())); |
| | | resVideo.setPlayTime((int) VideoUtil.getMp4Duration(file.getPath())); |
| | | resVideo.setName(name); |
| | | resVideo.setMediaVideoId(mediaVideoId); |
| | | resVideo.setStatus(ResItemVideo.STATUS_LINEUP); |
| | |
| | | |
| | | try { |
| | | video.setDeleteFlag(false); |
| | | video.setPlayTime((int) VideoUtil.getMp4Duration(resRootPath +"/"+ file.getPath())); |
| | | video.setPlayTime((int) VideoUtil.getMp4Duration(file.getPath())); |
| | | video.setName(file.getFileName()); |
| | | video.setOrigUrl(file.getPath()); |
| | | video.setStatus(MediaVideo.STATUS_LINEUP); |