Skip to content

Conversation

@garbit
Copy link

@garbit garbit commented Dec 2, 2025

This pull request adds a typescript version of the webrtc example and improves error handling and user feedback to the WebRTC player example, making it more user-friendly and resilient to connection issues. The main changes introduce a UI for displaying errors, a retry mechanism, and propagate session errors from the backend to the frontend.

User-facing improvements:

  • Added an error message overlay UI to example.html that displays connection or streaming errors to the user, with a "Retry Connection" button to attempt reconnection. [1] [2] [3] [4] [5]

Error handling and propagation:

  • Updated the StreamingSession and VideoPlayer classes in both webrtc-player.js and webrtc-player.ts to accept an errorCallback function, which is called whenever a streaming session error occurs (including disconnections or failures). This callback is used to trigger the UI error overlay. [1] [2] [3] [4]
  • Ensured that session termination in StreamingSession invokes the error callback, passing relevant error details to the UI. [1]

Retry mechanism:

  • Added logic in example.html to allow the user to retry the connection by clicking the "Retry Connection" button, which stops the current player and attempts to create a new one.

These changes provide clearer feedback and recovery options when streaming issues occur.

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.

1 participant