From f1ea4cc5a2f1fcf4a36b6a8b9f3b122fecc9ac4c Mon Sep 17 00:00:00 2001 From: "Timo K." Date: Mon, 5 Oct 2026 11:16:19 +0200 Subject: [PATCH] Merge `LocalMediaInputs` into `MatrixRTCClientOptions` The SDK now takes `publish` requests and audio output control directly in the main options object, removing the separate `LocalMediaInputs` type. Audio output device selection moves from a reactive behavior to an imperative method on `MatrixRTCClient`, giving hosts direct control over when devices switch. --- sdk/README.md | 6 +--- sdk/SdkArchitecture.md | 32 +++++++++--------- sdk/dev/main.ts | 19 +++-------- sdk/src/MatrixRTCClient.ts | 6 ++-- sdk/src/api.ts | 18 +++++----- sdk/src/media-backend/api.ts | 7 ++-- .../livekit/ConnectionFactory.ts | 25 +++++++++----- .../media-backend/livekit/LivekitBackend.ts | 12 +++++-- sdk/src/media-backend/livekit/LocalMedia.ts | 18 +++++++--- sdk/src/media-backend/livekit/Publisher.ts | 33 +++++-------------- 10 files changed, 88 insertions(+), 88 deletions(-) diff --git a/sdk/README.md b/sdk/README.md index 4c59ed632..800e6a04a 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -19,7 +19,6 @@ Call's own `CallViewModel` is built on it. It depends on nothing in Element Call ```ts import { - constant, createMatrixRTCClient, E2eeType, MatrixRTCMode, @@ -31,13 +30,10 @@ const rtcClient = createMatrixRTCClient( scope, client, // a matrix-js-sdk MatrixClient, logged in and syncing room, // the matrix-js-sdk Room, from client.getRoom() once the join has synced - { - publish: [{ source: "microphone" }, { source: "camera" }], - audioOutputDeviceId$: constant(undefined), - }, { encryptionSystem: { kind: E2eeType.PER_PARTICIPANT }, matrixRTCMode: MatrixRTCMode.Compatibility, + publish: [{ source: "microphone" }, { source: "camera" }], }, ); rtcClient.join(); diff --git a/sdk/SdkArchitecture.md b/sdk/SdkArchitecture.md index 4419a3aba..6ab774e33 100644 --- a/sdk/SdkArchitecture.md +++ b/sdk/SdkArchitecture.md @@ -18,7 +18,7 @@ therefore `Element Call → sdk`, never the reverse. The migration from today's ``` host application (Element Call, a whiteboard, watch-together, …) │ - │ createMatrixRTCClient(scope, matrixClient, room, localMedia, options) + │ createMatrixRTCClient(scope, matrixClient, room, options) ▼ ┌──────────────────────────────────────────────────────────────────────────────┐ │ MatrixRTCClient │ @@ -135,7 +135,7 @@ it, and `leave()` also sends the leave. | 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 | | +| 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 `