From dc983e5493f757e79130c4f3bd3a8a6d2251c9e7 Mon Sep 17 00:00:00 2001 From: "Timo K." Date: Thu, 8 Oct 2026 11:13:57 +0200 Subject: [PATCH] [SDK] split the clint object into -> slot and participation --- sdk/SdkArchitecture.md | 37 +-- sdk/dev/main.ts | 78 +++--- sdk/index.ts | 2 +- ...MatrixRTCClient.ts => RTCParticipation.ts} | 244 +++++++++--------- sdk/src/RTCSlot.ts | 185 +++++++++++++ sdk/src/api.ts | 208 ++++++++------- sdk/src/matrixrtc/LocalMember.test.ts | 26 +- sdk/src/matrixrtc/LocalMember.ts | 33 +-- sdk/src/matrixrtc/LocalTransport.ts | 4 +- sdk/src/matrixrtc/Members.ts | 80 +++--- sdk/src/matrixrtc/status.test.ts | 30 ++- sdk/src/matrixrtc/status.ts | 13 +- sdk/src/media-api.ts | 35 +++ sdk/src/media-backend/api.ts | 36 +-- .../media-backend/livekit/LivekitBackend.ts | 18 +- .../livekit/LivekitMemberMedia.ts | 12 +- sdk/src/media-backend/livekit/LocalMedia.ts | 27 +- 17 files changed, 653 insertions(+), 415 deletions(-) rename sdk/src/{MatrixRTCClient.ts => RTCParticipation.ts} (53%) create mode 100644 sdk/src/RTCSlot.ts diff --git a/sdk/SdkArchitecture.md b/sdk/SdkArchitecture.md index ad7fb3e8f..9b28ae2c5 100644 --- a/sdk/SdkArchitecture.md +++ b/sdk/SdkArchitecture.md @@ -126,23 +126,26 @@ it, and `leave()` also sends the leave. ## Vocabulary -| Word | Meaning here | Elsewhere | -| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | -| client | a `MatrixRTCClient`: one room, one slot, one local member | `MatrixClient` is always written out | -| membership | one device's MatrixRTC state event, seen by hosts as `RTCMembership`, the js-sdk `CallMembership` behind it | | -| member | an `RTCMember`: a membership plus what the SDK derives from it (display name, transport, media) | Element Call's "matrixLivekitMember" | -| media | what a member sends, once it has arrived on its transport: `tracks$` on the member, `null` while waiting for media, and `encryptionError$` beside it. The backend supplies the same two fields | Element Call's `MediaViewModel` is a view of it | -| track | a `MediaTrack`: one publication of a member, audio or video, with `source`, `kind`, `id` and the behaviors on it. `LocalAudioMediaTrack` and `LocalVideoMediaTrack` add the controls over our own | LiveKit `TrackPublication` and `Track`, which never leave the SDK | -| source | a `MediaSource`: what a track is captured from, `microphone`, `camera`, `screenShare`, `screenShareAudio` or `unknown`. Picked out of `tracks$` with `trackBySource$` | LiveKit `Track.Source` | -| publish request | a `PublishRequest`: a source, where to capture it from and how to encode it. Given at the join in `options.publish`, or later to `publish` on the local member | | -| active | `isActive$` on an audio track: the track carries sound, as the backend measures it. "Speaking" is a call's reading of it on the microphone track | LiveKit "speaking", `isSpeaking` | -| attach, detach | handing a `