Closed vitkuzmenko closed 4 months ago
Hello,
Thank you for the report and the PR. This is a bug, but I think that change the whole url parse is not necessary. I want use the same parse method in both protocols (RTMP and RTSP) and in Android. This is to make me easier maintain the code (if the code is similar I can follow it easier)
Instead of use URLComponents I think that check if the streamName is empty and avoid set a "/" in that case is enough. https://github.com/pedroSG94/RootEncoder-iOS/blob/master/RootEncoder/Sources/RootEncoder/rtsp/rtsp/RtspClient.swift#L85 I'm doing that on Android version where this error is fixed: https://github.com/pedroSG94/RootEncoder/blob/master/rtsp/src/main/java/com/pedro/rtsp/rtsp/RtspClient.kt#L207
Ok, I update commit
Thank you, merged
Description of Changes
This pull request removes the constraint that RTSP URLs must adhere to the format
rtsp://ip:port/appname/streamname
. The current implementation appends a trailing slash (/
) to the URL, which can cause issues with certain RTSP servers, such as mediamtx, that do not accept a trailing slash in the URL path.For example, my local mediamtx server generates URLs like
rtsp://192.168.0.X:8554/mystream
. With the existing implementation, using this URL results in an appended/
, causing the server to reject the URL.Changes Made
URLComponents
./
to the RTSP URL.Benefits
URLComponents
for URL parsing.Testing
rtsp://192.168.0.X:8554/mystream
is accepted without modification.