Skip to content

jpro-webrtc: cleanup, encapsulation, and README#120

Merged
FlorianKirmaier merged 2 commits into
mainfrom
cleanup/webrtc
Jun 15, 2026
Merged

jpro-webrtc: cleanup, encapsulation, and README#120
FlorianKirmaier merged 2 commits into
mainfrom
cleanup/webrtc

Conversation

@FlorianKirmaier

Copy link
Copy Markdown
Contributor

Documents jpro-webrtc and cleans up its API (the module deferred earlier so docs + API could land together). Hard rename — pre-1.0.

Docs

  • New README (published as the DOCUMENTATION artifact, 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.
  • Javadoc on all public classes/methods (there was almost none).

API cleanup (breaking, pre-1.0)

  • Encapsulated state: connectionState/iceConnectionState/iceGatheringState/signalingState are now read-only …Property() accessors; getTracks()/getIceCandidates() replace the public ObservableList fields.
  • Callbacks: setOnNewIceCandidate(...) / setOnNegotiationNeeded(...) replace the public mutable fields; onnegotiationneededonNegotiationNeeded.
  • MediaStream.js field → js() method.
  • Made internal JS-wiring private (listenToJS/listenToProperty).
  • Convenience: RTCPeerConnection.addStream(MediaStream) (resolves the stream for you) — removes the repetitive .js().thenAccept(... addStream ...) boilerplate.
  • Removed a debug System.out.println and commented-out dead code; consistent addTrack/removeTrack naming.

Examples updated to the new API.

Not in this PR (possible follow-up): hiding JSVariable behind typed wrappers (a Track type, MediaStream throughout) — the deeper redesign.

Verified: :jpro-webrtc and :jpro-webrtc:example compile; DOCUMENTATION artifact generates; README version in sync. Not runtime-tested — WebRTC is browser-only (needs a real browser + camera).

🤖 Generated with Claude Code

FlorianKirmaier and others added 2 commits June 15, 2026 00:48
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>
@FlorianKirmaier FlorianKirmaier merged commit 90d3609 into main Jun 15, 2026
2 checks passed
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