Adding typescript definition of webrtc-example and added an onErrorCallback hook to detect when webrtc fails #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
example.htmlthat 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:
StreamingSessionandVideoPlayerclasses in bothwebrtc-player.jsandwebrtc-player.tsto accept anerrorCallbackfunction, 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]StreamingSessioninvokes the error callback, passing relevant error details to the UI. [1]Retry mechanism:
example.htmlto 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.