jpro-webrtc: cleanup, encapsulation, and README#120
Merged
Conversation
Encapsulate the public API (read-only state properties, getTracks()/ getIceCandidates(), setOnNewIceCandidate/setOnNegotiationNeeded, MediaStream.js()), make JS-wiring helpers private, fix naming (onnegotiationneeded -> onNegotiationNeeded), remove debug output and dead code, and add an addStream(MediaStream) convenience. Adds Javadoc and a README (published as the DOCUMENTATION artifact); examples updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jpro-sipjs depends on jpro-webrtc and used the now-private MediaStream.js field. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Documents
jpro-webrtcand cleans up its API (the module deferred earlier so docs + API could land together). Hard rename — pre-1.0.Docs
DOCUMENTATIONartifact, added to the website doc list): what the module is, the four classes, a two-peers-on-one-page example, and a section on signaling for real cross-browser apps.API cleanup (breaking, pre-1.0)
connectionState/iceConnectionState/iceGatheringState/signalingStateare now read-only…Property()accessors;getTracks()/getIceCandidates()replace the publicObservableListfields.setOnNewIceCandidate(...)/setOnNegotiationNeeded(...)replace the public mutable fields;onnegotiationneeded→onNegotiationNeeded.MediaStream.jsfield →js()method.listenToJS/listenToProperty).RTCPeerConnection.addStream(MediaStream)(resolves the stream for you) — removes the repetitive.js().thenAccept(... addStream ...)boilerplate.System.out.printlnand commented-out dead code; consistentaddTrack/removeTracknaming.Examples updated to the new API.
Not in this PR (possible follow-up): hiding
JSVariablebehind typed wrappers (aTracktype,MediaStreamthroughout) — the deeper redesign.Verified:
:jpro-webrtcand:jpro-webrtc:examplecompile; DOCUMENTATION artifact generates; README version in sync. Not runtime-tested — WebRTC is browser-only (needs a real browser + camera).🤖 Generated with Claude Code