Skip to content

Fix: Rename from onerror to onerrorGo2rtc in VideoRTC - #5027

Open
IgorA100 wants to merge 2 commits into
ZoneMinder:masterfrom
IgorA100:patch-944150
Open

Fix: Rename from onerror to onerrorGo2rtc in VideoRTC#5027
IgorA100 wants to merge 2 commits into
ZoneMinder:masterfrom
IgorA100:patch-944150

Conversation

@IgorA100

Copy link
Copy Markdown
Contributor

Possible fix #5025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses the reported TypeError: this.onerror is not a function in the WebSocket error handler for the Go2RTC/WebRTC streaming path by renaming the handler to avoid colliding with the DOM’s onerror event-handler property on HTMLElement.

Changes:

  • Rename VideoRTC.onerror to VideoRTC.onerrorGo2rtc and update the WebSocket "error" event listener to call the new method.
  • Update VideoStream to override onerrorGo2rtc and call super.onerrorGo2rtc(ev).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
web/js/video-stream.js Renames the overridden WebSocket error handler to onerrorGo2rtc and updates the super call accordingly.
web/js/video-rtc.js Updates WebSocket "error" event wiring and renames the base handler method to onerrorGo2rtc.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: this.onerror is not a function onconnect/<@https://***.***.pl/zm/js/video-rtc.js:308:56

2 participants