diff --git a/eslint/SdkImportBoundary.js b/eslint/SdkImportBoundary.js index a86ab6196..5586f0ddd 100644 --- a/eslint/SdkImportBoundary.js +++ b/eslint/SdkImportBoundary.js @@ -22,8 +22,8 @@ const BANNED_PACKAGES = [ /** * Packages only a media backend may import. The session speaks MatrixRTC and - * sees media through `sdk/src/backend/api.ts`; a backend under - * `sdk/src/backend//` is the one place its protocol's library appears. + * sees media through `sdk/src/media-backend/api.ts`; a backend under + * `sdk/src/media-backend//` is the one place its protocol's library appears. */ const BACKEND_PACKAGES = ["livekit-client", "@livekit/"]; @@ -32,7 +32,7 @@ const BACKEND_PACKAGES = ["livekit-client", "@livekit/"]; * outside `sdk/` by relative path (that is `src/`, `component/`, * `playwright/`) or one of the packages above. The development harness under * `sdk/dev/` is a host, not part of the library, and is exempt. Keeps the - * session free of any one media backend, too: outside `sdk/src/backend/`, + * session free of any one media backend, too: outside `sdk/src/media-backend/`, * a backend's packages may only be imported for their types, and only in * the public API, the errors and the test helpers that have to name them. */ @@ -52,7 +52,7 @@ const rule = ESLintUtils.RuleCreator( bannedPackage: "The SDK must not import '{{specifier}}': a host supplies that, the SDK has no UI.", backendPackage: - "Only a media backend under sdk/src/backend/ may import '{{specifier}}'; the session sees media through backend/api.ts.", + "Only a media backend under sdk/src/media-backend/ may import '{{specifier}}'; the session sees media through media-backend/api.ts.", }, schema: [], }, @@ -63,7 +63,7 @@ const rule = ESLintUtils.RuleCreator( if (!filename.startsWith(sdkRoot)) return {}; if (filename.startsWith(resolve(sdkRoot, "dev") + sep)) return {}; const inBackend = filename.startsWith( - resolve(sdkRoot, "src", "backend") + sep, + resolve(sdkRoot, "src", "media-backend") + sep, ); const matchesPackage = (specifier, pkg) => diff --git a/sdk/README.md b/sdk/README.md index dffdb7fe4..4c59ed632 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -6,7 +6,7 @@ the media of every member, as observables. It has no UI. Element Call's own `CallViewModel` is meant to become one consumer of it. The design is in [`SdkArchitecture.md`](./SdkArchitecture.md), the migration from the view model in [`SdkMigration.md`](./SdkMigration.md). Media goes through one media backend -behind `MediaBackend`; LiveKit, under `src/backend/livekit/`, is the only one +behind `MediaBackend`; LiveKit, under `src/media-backend/livekit/`, is the only one today and the only place that imports `livekit-client`. **Status:** first implementation. `createMatrixRTCClient` joins the session, connects to diff --git a/sdk/SdkArchitecture.md b/sdk/SdkArchitecture.md index b2ff14db1..4419a3aba 100644 --- a/sdk/SdkArchitecture.md +++ b/sdk/SdkArchitecture.md @@ -64,10 +64,10 @@ therefore `Element Call → sdk`, never the reverse. The migration from today's The left box is MatrixRTC: who is in the session, with which transport, the keys, the delayed leave, and the join state machine. The right box is a media backend: whatever carries the media, behind the `MediaBackend` interface in -`sdk/src/backend/api.ts`. The client is the join of the two: a member exists +`sdk/src/media-backend/api.ts`. The client is the join of the two: a member exists once its membership does, and gets its media once the backend has something for that membership on its transport. LiveKit is the one backend today; a -cascading SFU or full mesh is another folder under `sdk/src/backend/`, handed +cascading SFU or full mesh is another folder under `sdk/src/media-backend/`, handed in through `options.backend`, and nothing in the left box changes. ### How Element Call uses it @@ -127,20 +127,20 @@ 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 | a `MemberMedia`: what a member sends, once it has arrived on its transport. `null` while waiting for media | 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 `LocalMediaInputs.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 `