handled RTSP video stream requests without authentication

This commit is contained in:
Valmo Trindade
2025-04-16 05:34:27 -03:00
parent ca4231f669
commit 162f3c7e7a
2 changed files with 10 additions and 5 deletions

View File

@@ -34,10 +34,15 @@ pub fn start_stream(
#[cfg(target_os = "windows")]
{
let (tx, rx): (Sender<()>, Receiver<()>) = mpsc::channel();
let rtsp_url = format!(
"rtsp://{}:{}@{}:{}/{}",
username, password, address, port, stream_path
);
let rtsp_url = if username.is_empty() || password.is_empty() {
format!("rtsp://{}:{}/{}", address, port, stream_path)
} else {
format!(
"rtsp://{}:{}@{}:{}/{}",
username, password, address, port, stream_path
)
};
let rtsp_url_clone = rtsp_url.clone();
thread::spawn(move || {