Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
EIP-Integration
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
李炎
EIP-Integration
Commits
cb8ecb19
提交
cb8ecb19
authored
9月 14, 2021
作者:
李炎
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改配置
上级
f9d43c5e
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
8 行增加
和
7 行删除
+8
-7
HlsAlterController.java
...modules/iost/API/controller/video/HlsAlterController.java
+2
-1
HlsController.java
...eecg/modules/iost/API/controller/video/HlsController.java
+6
-6
没有找到文件。
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/controller/video/HlsAlterController.java
浏览文件 @
cb8ecb19
...
@@ -35,6 +35,7 @@ public class HlsAlterController {
...
@@ -35,6 +35,7 @@ public class HlsAlterController {
@Value
(
"${server.localip}"
)
@Value
(
"${server.localip}"
)
private
String
ip
;
private
String
ip
;
private
String
dockerip
=
"www.lingqingkeji.com"
;
public
HlsAlterController
()
throws
UnknownHostException
{
public
HlsAlterController
()
throws
UnknownHostException
{
}
}
...
@@ -51,7 +52,7 @@ public class HlsAlterController {
...
@@ -51,7 +52,7 @@ public class HlsAlterController {
String
indexStr
=
getIndexFile
(
originUrlpath
);
//解析originUrlpath 返回为文本
String
indexStr
=
getIndexFile
(
originUrlpath
);
//解析originUrlpath 返回为文本
List
urlList
=
analysisIndex
(
indexStr
);
//解析indexStr获取.ts文件地址
List
urlList
=
analysisIndex
(
indexStr
);
//解析indexStr获取.ts文件地址
String
inIp
=
"192.168.2.209"
;
String
inIp
=
"192.168.2.209"
;
String
localPath
=
"http://"
+
ip
+
":"
+
port
+
path
+
"/"
;
String
localPath
=
"http://"
+
docker
ip
+
":"
+
port
+
path
+
"/"
;
for
(
int
i
=
0
;
i
<
urlList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
urlList
.
size
();
i
++)
{
String
url
=
urlList
.
get
(
i
).
toString
();
//
String
url
=
urlList
.
get
(
i
).
toString
();
//
InputStream
fileInputStream
=
getFileInputStream
(
url
);
InputStream
fileInputStream
=
getFileInputStream
(
url
);
...
...
jeecg-boot-module-system/src/main/java/org/jeecg/modules/iost/API/controller/video/HlsController.java
浏览文件 @
cb8ecb19
...
@@ -40,7 +40,7 @@ public class HlsController {
...
@@ -40,7 +40,7 @@ public class HlsController {
private
String
path
;
private
String
path
;
@Value
(
"${server.localip}"
)
@Value
(
"${server.localip}"
)
private
String
ip
;
private
String
ip
;
private
String
dockerip
=
"www.lingqingkeji.com"
;
public
HlsController
()
throws
UnknownHostException
{
public
HlsController
()
throws
UnknownHostException
{
}
}
...
@@ -56,7 +56,7 @@ public class HlsController {
...
@@ -56,7 +56,7 @@ public class HlsController {
//读取指定路径下面的文件
//读取指定路径下面的文件
String
indexStr
=
getIndexFile
(
originUrlpath
);
//解析originUrlpath 返回为文本
String
indexStr
=
getIndexFile
(
originUrlpath
);
//解析originUrlpath 返回为文本
List
urlList
=
analysisIndex
(
indexStr
);
//解析indexStr获取.ts文件地址
List
urlList
=
analysisIndex
(
indexStr
);
//解析indexStr获取.ts文件地址
String
localPath
=
"http://"
+
ip
+
":"
+
port
+
path
+
"/"
;
String
localPath
=
"http://"
+
docker
ip
+
":"
+
port
+
path
+
"/"
;
System
.
out
.
println
(
urlList
);
System
.
out
.
println
(
urlList
);
for
(
int
i
=
0
;
i
<
urlList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
urlList
.
size
();
i
++)
{
String
tsUrl
=
UUID
.
randomUUID
().
toString
()
+
".ts"
;
//文件后缀,key
String
tsUrl
=
UUID
.
randomUUID
().
toString
()
+
".ts"
;
//文件后缀,key
...
@@ -115,13 +115,13 @@ public class HlsController {
...
@@ -115,13 +115,13 @@ public class HlsController {
/*读取网络文件*/
/*读取网络文件*/
@GetMapping
(
"/GetTs/{path}"
)
@GetMapping
(
"/GetTs/{path}"
)
public
void
getFileInputStream
(
@PathVariable
()
String
path
,
HttpServletResponse
response
)
{
public
void
getFileInputStream
(
@PathVariable
()
String
path
,
HttpServletResponse
response
)
{
System
.
out
.
println
(
"GetTs"
+
path
);
System
.
out
.
println
(
"GetTs"
+
path
);
String
s
=
urlPath
.
get
(
path
);
String
s
=
urlPath
.
get
(
path
);
System
.
out
.
println
(
"path"
+
s
);
System
.
out
.
println
(
"path"
+
s
);
System
.
out
.
println
(
urlPath
);
System
.
out
.
println
(
urlPath
);
URL
url
=
null
;
URL
url
=
null
;
try
{
try
{
url
=
new
URL
(
s
+
"?Usr=c1cbc1d4e86d49a0981f54beea95280a"
);
url
=
new
URL
(
s
+
"?Usr=c1cbc1d4e86d49a0981f54beea95280a"
);
HttpURLConnection
conn
=
(
HttpURLConnection
)
url
.
openConnection
();
HttpURLConnection
conn
=
(
HttpURLConnection
)
url
.
openConnection
();
//设置超时间为3秒
//设置超时间为3秒
conn
.
setConnectTimeout
(
3
*
1000
);
conn
.
setConnectTimeout
(
3
*
1000
);
...
@@ -148,7 +148,7 @@ public class HlsController {
...
@@ -148,7 +148,7 @@ public class HlsController {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"读取网络文件异常:"
+
path
);
System
.
out
.
println
(
"读取网络文件异常:"
+
path
);
// logger.error("读取网络文件异常:"+path);
// logger.error("读取网络文件异常:"+path);
}
finally
{
}
finally
{
urlPath
.
remove
(
path
);
urlPath
.
remove
(
path
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论