mirror of
https://github.com/KOHGYLW/kiftd-source.git
synced 2025-01-08 12:07:47 +08:00
update to v1.2.0 进一步完善了在线解码功能
This commit is contained in:
parent
00ce501a6a
commit
1d912ec222
@ -50,7 +50,7 @@ public class PlayVideoServiceImpl implements PlayVideoService {
|
||||
final String suffix = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
|
||||
switch (suffix) {
|
||||
case "mp4":
|
||||
if (kfl.getExecutablePath() != null) {
|
||||
if (kfl.isEnableFFmpeg()) {
|
||||
// 因此对于mp4后缀的视频,进一步检查其编码是否为h264,如果是,则允许直接播放
|
||||
File target = fbu.getFileFromBlocks(f);
|
||||
if (target == null || !target.isFile()) {
|
||||
@ -79,7 +79,7 @@ public class PlayVideoServiceImpl implements PlayVideoService {
|
||||
case "avi":
|
||||
case "wmv":
|
||||
case "flv":
|
||||
if (kfl.getExecutablePath() != null) {
|
||||
if (kfl.isEnableFFmpeg()) {
|
||||
vi.setNeedEncode("Y");
|
||||
} else {
|
||||
vi.setNeedEncode("N");
|
||||
|
@ -100,7 +100,7 @@ public class ResourceServiceImpl implements ResourceService {
|
||||
case ".wmv":
|
||||
case ".mkv":
|
||||
case ".flv":
|
||||
if (kfl.getExecutablePath() != null) {
|
||||
if (kfl.isEnableFFmpeg()) {
|
||||
contentType = "video/mp4";
|
||||
synchronized (VideoTranscodeUtil.videoTranscodeThreads) {
|
||||
VideoTranscodeThread vtt = VideoTranscodeUtil.videoTranscodeThreads.get(fid);
|
||||
@ -154,16 +154,11 @@ public class ResourceServiceImpl implements ResourceService {
|
||||
* </p>
|
||||
*
|
||||
* @author 青阳龙野(kohgylw)
|
||||
* @param resource
|
||||
* java.io.File 要发送的文件资源
|
||||
* @param fname
|
||||
* java.lang.String 要传递给客户端的文件名,会加入到响应头中
|
||||
* @param contentType
|
||||
* java.lang.String 返回资源的CONTENT_TYPE标识名,例如“text/html”
|
||||
* @param request
|
||||
* javax.servlet.http.HttpServletRequest 请求对象
|
||||
* @param response
|
||||
* javax.servlet.http.HttpServletResponse 响应对象
|
||||
* @param resource java.io.File 要发送的文件资源
|
||||
* @param fname java.lang.String 要传递给客户端的文件名,会加入到响应头中
|
||||
* @param contentType java.lang.String 返回资源的CONTENT_TYPE标识名,例如“text/html”
|
||||
* @param request javax.servlet.http.HttpServletRequest 请求对象
|
||||
* @param response javax.servlet.http.HttpServletResponse 响应对象
|
||||
* @return int 操作完毕后返回的状态码,例如“200”
|
||||
*/
|
||||
private int sendResource(File resource, String fname, String contentType, HttpServletRequest request,
|
||||
@ -369,7 +364,7 @@ public class ResourceServiceImpl implements ResourceService {
|
||||
|
||||
@Override
|
||||
public String getVideoTranscodeStatus(HttpServletRequest request) {
|
||||
if (kfl.getExecutablePath() != null) {
|
||||
if (kfl.isEnableFFmpeg()) {
|
||||
String fId = request.getParameter("fileId");
|
||||
if (fId != null) {
|
||||
try {
|
||||
|
@ -1,5 +1,5 @@
|
||||
#Generated by Maven Integration for Eclipse
|
||||
#Sat Jan 13 17:31:21 CST 2024
|
||||
#Sat Jan 13 17:49:51 CST 2024
|
||||
m2e.projectLocation=/Users/kohgylw/Programs/java_workspace/kiftd
|
||||
m2e.projectName=kiftd
|
||||
groupId=kohgylw
|
||||
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user