From df9f6a8927fb0451d1201204be984ff52ec7a83f Mon Sep 17 00:00:00 2001 From: xiaoQQya Date: Mon, 20 Mar 2023 14:56:46 +0800 Subject: [PATCH] =?UTF-8?q?perf(streamInfo):=20=E4=BC=98=E5=8C=96=E7=82=B9?= =?UTF-8?q?=E6=92=AD=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E6=B5=81=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E4=B8=AD=E7=9A=84=20RTMP/RTSP/RTC=20=E9=93=BE?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java b/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java index 8311745c..9d4323ba 100644 --- a/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java +++ b/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java @@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.common; import io.swagger.v3.oas.annotations.media.Schema; import java.io.Serializable; +import java.util.Objects; @Schema(description = "流信息") public class StreamInfo implements Serializable, Cloneable{ @@ -168,7 +169,7 @@ public class StreamInfo implements Serializable, Cloneable{ } public void setRtmp(String host, int port, int sslPort, String app, String stream, String callIdParam) { - String file = String.format("%s/%s/%s", app, stream, callIdParam); + String file = String.format("%s/%s%s", app, stream, callIdParam); if (port > 0) { this.rtmp = new StreamURL("rtmp", host, port, file); } @@ -178,7 +179,7 @@ public class StreamInfo implements Serializable, Cloneable{ } public void setRtsp(String host, int port, int sslPort, String app, String stream, String callIdParam) { - String file = String.format("%s/%s/%s", app, stream, callIdParam); + String file = String.format("%s/%s%s", app, stream, callIdParam); if (port > 0) { this.rtsp = new StreamURL("rtsp", host, port, file); } @@ -237,6 +238,7 @@ public class StreamInfo implements Serializable, Cloneable{ } public void setRtc(String host, int port, int sslPort, String app, String stream, String callIdParam) { + callIdParam = Objects.equals(callIdParam, "") ? callIdParam : callIdParam.replace("?", "&"); String file = String.format("index/api/webrtc?app=%s&stream=%s&type=play%s", app, stream, callIdParam); if (port > 0) { this.rtc = new StreamURL("http", host, port, file);