提交 cb8ecb19 authored 作者: 李炎's avatar 李炎

修改配置

上级 f9d43c5e
......@@ -35,6 +35,7 @@ public class HlsAlterController {
@Value("${server.localip}")
private String ip;
private String dockerip = "www.lingqingkeji.com";
public HlsAlterController() throws UnknownHostException {
}
......@@ -51,7 +52,7 @@ public class HlsAlterController {
String indexStr = getIndexFile(originUrlpath);//解析originUrlpath 返回为文本
List urlList = analysisIndex(indexStr);//解析indexStr获取.ts文件地址
String inIp="192.168.2.209";
String localPath = "http://" + ip + ":" + port + path + "/";
String localPath = "http://" + dockerip + ":" + port + path + "/";
for (int i = 0; i < urlList.size(); i++) {
String url = urlList.get(i).toString();//
InputStream fileInputStream = getFileInputStream(url);
......
......@@ -40,7 +40,7 @@ public class HlsController {
private String path;
@Value("${server.localip}")
private String ip;
private String dockerip = "www.lingqingkeji.com";
public HlsController() throws UnknownHostException {
}
......@@ -56,7 +56,7 @@ public class HlsController {
//读取指定路径下面的文件
String indexStr = getIndexFile(originUrlpath);//解析originUrlpath 返回为文本
List urlList = analysisIndex(indexStr);//解析indexStr获取.ts文件地址
String localPath = "http://" + ip + ":" + port + path + "/";
String localPath = "http://" + dockerip + ":" + port + path + "/";
System.out.println(urlList);
for (int i = 0; i < urlList.size(); i++) {
String tsUrl = UUID.randomUUID().toString() + ".ts";//文件后缀,key
......@@ -115,13 +115,13 @@ public class HlsController {
/*读取网络文件*/
@GetMapping("/GetTs/{path}")
public void getFileInputStream(@PathVariable() String path, HttpServletResponse response) {
System.out.println("GetTs"+path);
System.out.println("GetTs" + path);
String s = urlPath.get(path);
System.out.println("path"+s);
System.out.println("path" + s);
System.out.println(urlPath);
URL url = null;
try {
url = new URL(s+"?Usr=c1cbc1d4e86d49a0981f54beea95280a");
url = new URL(s + "?Usr=c1cbc1d4e86d49a0981f54beea95280a");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
//设置超时间为3秒
conn.setConnectTimeout(3 * 1000);
......@@ -148,7 +148,7 @@ public class HlsController {
} catch (Exception e) {
System.out.println("读取网络文件异常:" + path);
// logger.error("读取网络文件异常:"+path);
}finally {
} finally {
urlPath.remove(path);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论