-
-
Notifications
You must be signed in to change notification settings - Fork 511
Description
Mainsail Version:
2.13.2
Browser:
Safari
Device:
Laptop
Operating System:
macOS
What happened?
Added webcam (go2rtc) integration to my local go2rtc instance hosted by home assistant/frigate.
Stream URL: http://hass.local:1984?cam=ender3pro_cam
Snapshot URL: http://hass.local:1984/api/frame.jpeg?cam=ender3pro_cam
This stream works fine except that there is a blip every 40-ish seconds it disconnects and reconnects the stream.
[Log] [WebRTC go2rtc] connecting to ws://hass.local:1984/api/ws?src=ender3pro_cam&media=video (WebrtcGo2rtc-2a46754e.js, line 1)
[Log] [WebRTC go2rtc] open (WebrtcGo2rtc-2a46754e.js, line 1)
[Log] [WebRTC go2rtc] connection state changed – "connecting" (WebrtcGo2rtc-2a46754e.js, line 1)
[Log] [WebRTC go2rtc] connection state changed – "connected" (WebrtcGo2rtc-2a46754e.js, line 1)
[Log] [WebRTC go2rtc] connection state changed – "disconnected" (WebrtcGo2rtc-2a46754e.js, line 1)
[Log] [WebRTC go2rtc] terminating (WebrtcGo2rtc-2a46754e.js, line 1)
[Log] [WebRTC go2rtc] close (WebrtcGo2rtc-2a46754e.js, line 1)
[Log] [WebRTC go2rtc] connecting to ws://hass.local:1984/api/ws?src=ender3pro_cam&media=video (WebrtcGo2rtc-2a46754e.js, line 1)
[Log] [WebRTC go2rtc] open (WebrtcGo2rtc-2a46754e.js, line 1)
[Log] [WebRTC go2rtc] connection state changed – "connecting" (WebrtcGo2rtc-2a46754e.js, line 1)
[Log] [WebRTC go2rtc] connection state changed – "connected" (WebrtcGo2rtc-2a46754e.js, line 1)
The time between the "connected" and "disconnected" lines is consistently about 40 seconds.
What did you expect to happen instead?
no blip - solid stream like on Chrome
How to reproduce this bug?
I'm using Safari Version 18.4 (20621.1.15.11.10) on macOS 15.4. This issue does not occur when I use Chrome Version 135.0.7049.85 (Official Build) (arm64) and appears to be specific to Safari in my testing. I have also reproduced this issue using Safari on iOS.
Additional information:
I spent some time trying to debug this and as I said above this appears to be specific to Safari as I've had my Chrome tab open for 20 minutes without any issue, no drops / reconnects. With or without the STUN config change I mention below - Chrome is rock solid.
I googled around about webrtc connections dropping after 40 seconds and uncovered some comments about Safari, mostly on iOS, having issues with ICE server config / connections and manifesting in similar timeouts. With that in mind I tweaked the javascript to comment out the default iceServers config here:
| iceServers: [{ urls: 'stun:stun.l.google.com:19302' }], |