WebRTC
WebRTC copied to clipboard
InvalidStateError: The object is in an invalid state /webrtc/video-rtc.js
I did isolate the issue on an empty dashboard with just one card:
type: custom:webrtc-camera
server: http://192.168.20.3:1984
streams:
- url: e1
mode: webrtc, mse
media: video,audio
name: 🎙️OFF
- url: e1
mode: webrtc
media: video, audio, microphone
name: 🎙️ON
muted: false
ui: false
ptz:
service: onvif.ptz
data_left:
entity_id: camera.reolink_e1_pro_profile000_mainstream
pan: LEFT
move_mode: ContinuousMove
continuous_duration: 0.2
data_right:
entity_id: camera.reolink_e1_pro_profile000_mainstream
pan: RIGHT
move_mode: ContinuousMove
continuous_duration: 0.2
data_up:
entity_id: camera.reolink_e1_pro_profile000_mainstream
tilt: UP
move_mode: ContinuousMove
continuous_duration: 0.2
data_down:
entity_id: camera.reolink_e1_pro_profile000_mainstream
tilt: DOWN
move_mode: ContinuousMove
continuous_duration: 0.2
My go2rtc config:
streams:
e1:
- rtsp://user:pw@IP/Preview_01_main
- ffmpeg:e1#audio=opus
webrtc:
candidates:
- 192.168.20.3:8555
- stun:8555
api:
origin: '*'
hass:
config: /homeassistant
log:
format: text
ffmpeg:
bin: /usr/lib/ffmpeg/7.0/bin/ffmpeg
I can see the video, audio, even 2 way audio works. But everytime I access the dashboard or reload the page I get this error thrown into the Home Assistant logs:
Logger: frontend.js.modern.202508111
Source: components/system_log/__init__.py:331
First occurred: 17:32:06 (1 occurrence)
Last logged: 17:32:06
Uncaught error from Safari 18.6 on macOS 10.15.7 InvalidStateError: The object is in an invalid state. /webrtc/video-rtc.js:452:39
I have the same issue for quite a long time. I though it has something to do with connection closure when HASS App goes to background or is not used for a while