Skip to content

Commit 7d59cdc

Browse files
committed
Fixed SRT URL and added username and password to work with MediaMTX auth
1 parent 57e596c commit 7d59cdc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/src/main/java/io/opentakserver/opentakicu/Camera2Service.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,12 +1019,16 @@ public void startStream() {
10191019

10201020
// Support for MediaMTX's way of doing RTMP authentication
10211021
if (protocol.startsWith("rtmp") && !username.equals(Preferences.STREAM_USERNAME_DEFAULT) && !password.equals(Preferences.STREAM_PASSWORD_DEFAULT)) {
1022-
url = url.concat("/").concat(path).concat("?user=").concat(username).concat("&pass=").concat(password);
1022+
url = url.concat("/").concat(path);
1023+
if (username != null && !username.isEmpty())
1024+
url = url.concat("?user=").concat(username).concat("&pass=").concat(password);
10231025
}
10241026
else if (!protocol.equals("udp") && !protocol.equals("srt"))
10251027
url = url.concat("/").concat(path);
10261028
else if (protocol.equals("srt")) {
1027-
url += "/publish:" + path;
1029+
url += "?streamid=publish:" + path;
1030+
if (username != null && !username.isEmpty())
1031+
url += ":" + username + ":" + password;
10281032
}
10291033
// UDP Multicast
10301034
else {

0 commit comments

Comments
 (0)