|
|
@@ -11,8 +11,6 @@ import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.net.URLEncoder;
|
|
|
-import java.nio.charset.StandardCharsets;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
@@ -29,9 +27,6 @@ import java.util.Objects;
|
|
|
public class ApiProxy {
|
|
|
private final StreamMediaProperties streamMediaProperties;
|
|
|
|
|
|
- private String encode(String url) {
|
|
|
- return URLEncoder.encode(url, StandardCharsets.UTF_8);
|
|
|
- }
|
|
|
|
|
|
private String getHttp(ApiInfo apiInfo, Map<String, Object> para) {
|
|
|
log.debug("{}入参->{}", apiInfo.getDesc(), JSONObject.toJSONString(para));
|
|
|
@@ -129,7 +124,7 @@ public class ApiProxy {
|
|
|
public Object rtmpPush(String streamPath, String target) {
|
|
|
String sync = getHttp(ApiInfo.RTMP_PUSH, new HashMap<>() {{
|
|
|
put("streamPath", streamPath);
|
|
|
- put("target", encode(target));
|
|
|
+ put("target", target);
|
|
|
}});
|
|
|
return JSONObject.parseObject(sync, new TypeReference<>() {
|
|
|
});
|
|
|
@@ -138,7 +133,7 @@ public class ApiProxy {
|
|
|
public Object rtmpPull(String streamPath, String target, String save) {
|
|
|
return getHttp(ApiInfo.RTMP_PULL, new HashMap<>() {{
|
|
|
put("streamPath", streamPath);
|
|
|
- put("target", encode(target));
|
|
|
+ put("target", target);
|
|
|
put("save", save);
|
|
|
}});
|
|
|
}
|
|
|
@@ -164,7 +159,7 @@ public class ApiProxy {
|
|
|
public Object rtspPush(String streamPath, String target) {
|
|
|
String sync = getHttp(ApiInfo.RTSP_PUSH, new HashMap<>() {{
|
|
|
put("streamPath", streamPath);
|
|
|
- put("target", encode(target));
|
|
|
+ put("target", target);
|
|
|
}});
|
|
|
return JSONObject.parseObject(sync, new TypeReference<>() {
|
|
|
});
|
|
|
@@ -173,7 +168,7 @@ public class ApiProxy {
|
|
|
public Object rtspPull(String streamPath, String target, String save) {
|
|
|
return getHttp(ApiInfo.RTSP_PULL, new HashMap<>() {{
|
|
|
put("streamPath", streamPath);
|
|
|
- put("target", encode(target));
|
|
|
+ put("target", target);
|
|
|
put("save", save);
|
|
|
}});
|
|
|
}
|
|
|
@@ -188,6 +183,7 @@ public class ApiProxy {
|
|
|
return JSONObject.parseObject(sync, new TypeReference<>() {
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
public Object recordDelete(String path) {
|
|
|
return getHttp(ApiInfo.RECORD_DELETE, new HashMap<>() {{
|
|
|
put("path", path);
|