Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webrtc don't work #2621

Closed
2 of 13 tasks
pikachu937 opened this issue Nov 1, 2023 · 5 comments · Fixed by #2814
Closed
2 of 13 tasks

webrtc don't work #2621

pikachu937 opened this issue Nov 1, 2023 · 5 comments · Fixed by #2814

Comments

@pikachu937
Copy link

Which version are you using?

v1.X.X and later

Which operating system are you using?

  • Linux amd64 standard
  • Linux amd64 Docker
  • Linux arm64 standard
  • Linux arm64 Docker
  • Linux arm7 standard
  • Linux arm7 Docker
  • Linux arm6 standard
  • Linux arm6 Docker
  • Windows amd64 standard
  • Windows amd64 Docker (WSL backend)
  • macOS amd64 standard
  • macOS amd64 Docker
  • Other (LXC)

Describe the issue

Description

Since version 1.X.X, in the old version of the chrome browser (66 and up to 74), webrtc links (https://external-ip:port/stream) no longer open, the browser cannot log in and, as a result, a black screen is visible. the same problem on phones with the android 9(pie) operating system. It’s not difficult to update the browser on a computer to version 75, but on a phone it’s quite problematic.

in version 0.23.8 everything works fine

log from server

2023/11/01 16:27:36 DEB [WebRTC] [conn X.X.X.X:11470] OPTIONS /path1/whep
2023/11/01 16:27:36 DEB [WebRTC] [conn X.X.X.X:11470] [c->s] OPTIONS /path1/whep?controls=0 HTTP/2.0
Host: external-ip:port
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7
Origin: https://external-ip:port
Referer: https://external-ip:port/path1/?controls=0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36

2023/11/01 16:27:36 DEB [WebRTC] [conn X.X.X.X:11470] [s->c] HTTP/1.1 401 Unauthorized
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Server: mediamtx
Www-Authenticate: Basic realm="mediamtx"

2023/11/01 16:27:38 DEB [WebRTC] [conn X.X.X.X:11470] OPTIONS /path1/whep
2023/11/01 16:27:38 DEB [WebRTC] [conn X.X.X.X:11470] [c->s] OPTIONS /path1/whep?controls=0 HTTP/2.0
Host: external-ip:port
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7
Origin: https://external-ip:port
Referer: https://external-ip:port/path1/?controls=0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36

2023/11/01 16:27:38 DEB [WebRTC] [conn X.X.X.X:11470] [s->c] HTTP/1.1 401 Unauthorized
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Server: mediamtx
Www-Authenticate: Basic realm="mediamtx"

2023/11/01 16:27:40 DEB [WebRTC] [conn X.X.X.X:11470] OPTIONS /path1/whep
2023/11/01 16:27:40 DEB [WebRTC] [conn X.X.X.X:11470] [c->s] OPTIONS /path1/whep?controls=0 HTTP/2.0
Host: external-ip:port
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7
Origin: https://external-ip:port
Referer: https://external-ip:port/path1/?controls=0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36

log from android 9

requesting ICE servers
:port/favicon.ico:1 Failed to load resource: the server responded with a status of 404 ()
:port/path1/whep?controls=0:1 Failed to load resource: the server responded with a status of 401 ()
?controls=0:115 error: TypeError: this.pc.addTransceiver is not a function
?controls=0:108 requesting ICE servers
:port/path1/whep?controls=0:1 Failed to load resource: the server responded with a status of 401 ()
?controls=0:115 error: TypeError: this.pc.addTransceiver is not a function
?controls=0:108 requesting ICE servers
?controls=0:110 OPTIONS https://external-ip:port/path1/whep?controls=0 401 ()
start @ ?controls=0:110
restartTimeout.window.setTimeout @ ?controls=0:243
?controls=0:115 error: TypeError: this.pc.addTransceiver is not a function
?controls=0:108 requesting ICE servers
?controls=0:110 OPTIONS https://external-ip:port/path1/whep?controls=0 401 ()
start @ ?controls=0:110
restartTimeout.window.setTimeout @ ?controls=0:243
setTimeout (async)
scheduleRestart @ ?controls=0:241
fetch.then.catch @ ?controls=0:116
Promise.catch (async)
start @ ?controls=0:114
restartTimeout.window.setTimeout @ ?controls=0:243
?controls=0:115 error: TypeError: this.pc.addTransceiver is not a function
?controls=0:108 requesting ICE servers
?controls=0:110 OPTIONS https://external-ip:port/path1/whep?controls=0 401 ()

log from browser on pc

scheduleRestart @ ?controls=0:285
fetch.then.catch @ ?controls=0:158
Promise.catch (async)
start @ ?controls=0:156
restartTimeout.window.setTimeout @ ?controls=0:287
setTimeout (async)
scheduleRestart @ ?controls=0:285
fetch.then.catch @ ?controls=0:158
Promise.catch (async)
start @ ?controls=0:156
restartTimeout.window.setTimeout @ ?controls=0:287
?controls=0:157 error: TypeError: this.pc.addTransceiver is not a function
?controls=0:150 requesting ICE servers
?controls=0:152 
start @ ?controls=0:152
restartTimeout.window.setTimeout @ ?controls=0:287
setTimeout (async)
scheduleRestart @ ?controls=0:285
fetch.then.catch @ ?controls=0:158
Promise.catch (async)
start @ ?controls=0:156
restartTimeout.window.setTimeout @ ?controls=0:287
setTimeout (async)
scheduleRestart @ ?controls=0:285
fetch.then.catch @ ?controls=0:158
Promise.catch (async)
start @ ?controls=0:156
restartTimeout.window.setTimeout @ ?controls=0:287
setTimeout (async)
scheduleRestart @ ?controls=0:285
fetch.then.catch @ ?controls=0:158
Promise.catch (async)
start @ ?controls=0:156
restartTimeout.window.setTimeout @ ?controls=0:287
setTimeout (async)
scheduleRestart @ ?controls=0:285
fetch.then.catch @ ?controls=0:158

While examining the code, I discovered that the js part in webrtc_read_index.html had been changed

Describe how to replicate the issue

  1. start the server
  2. publish with rtsp
  3. read with browser(android9 phone or pc)

Did you attach the server logs?

yes / no

Did you attach a network dump?

yes / no

@pikachu937
Copy link
Author

aler9 please help me fix this bug

@pikachu937
Copy link
Author

UPD.
I apologize if I misled you. Swears on the ice server, from updated information.

"error: InvalidStateError: Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'. 'unified-plan' will become the default behavior in the future, but it is currently experimental. To try it out, construct the RTCPeerConnection with sdpSemantics:'unified-plan' present in the RTCConfiguration argument.", source: https://external-ip:port/path1/ (116)

@aler9
Copy link
Member

aler9 commented Dec 16, 2023

Hello, after digging i found out the explanation for this problem. Even though it involves a small number of users, i added the sdpSemantics parameter inside the server in order to support Chrome versions older than M72.

Copy link
Contributor

This issue is mentioned in release v1.4.1 🚀
Check out the entire changelog by clicking here

Copy link
Contributor

This issue is being locked automatically because it has been closed for more than 6 months.
Please open a new issue in case you encounter a similar problem.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants