42 Commits
Author SHA1 Message Date
Timo K. 38c28a1c8f scaling based on component size instead webview size 2026-09-04 14:16:40 +02:00
Valere 6b5f396e1e Share the mapping from parameters to call view model options
The SDK stopped sending join notifications: it threaded callIntent into
createCallViewModel$ but not its pair sendNotificationType, which
enterRTCSession used to read for itself, so an explicit
?sendNotificationType=ring — or an intent that implies one — no longer
reached joinRTCSession.

The mechanism is worth fixing rather than the instance. The defaults on
CallViewModelOptions describe a standalone Element Call, so a widget
caller that misses a field gets standalone behaviour rather than an error,
and the SDK is only ever a widget. Give both callers one shared mapping so
they cannot drift, and cover the whole chain from URL to options in tests.

autoLeaveWhenOthersLeft and waitForCallPickup stay out of it: the view
model never read those from the parameters, so enabling them for the SDK
would be a change in its behaviour rather than a fix.
2026-09-02 19:26:33 +02:00
Valere 182be8676d Return the widget from initializeWidget instead of assigning a global
Element Call reached the widget API through a mutable module-level
binding, which every consumer imported directly. Nothing outside the app
shell needs it any more, so hand it back from initializeWidget and thread
it through: the initializer returns it, main passes it to App, and App
uses it to build the host bridge and to await the client the host is
lending us.

ClientContext's loadClient is now only about restoring or creating a
session of Element Call's own, since a widget's client arrives as a prop
like any other host's would.

Also fixes an early return added in the previous commit, which skipped
starting the analytics settings listener when a client was supplied. That
was harmless until now, but would have stopped analytics following the
user's choices in widget mode.

sdk/main.ts asked the host to close by hand; it now uses the bridge, which
also stops the transport as the app does.
2026-09-02 16:56:09 +02:00
Valere bc6c232ef0 Move the state layer onto the host bridge
MuteStates, CallViewModel and LocalMember reached the host through the
widget global. None of them are React components, so they take the bridge
as an explicit parameter: a constructor argument for MuteStates, a field
on CallViewModelOptions, and one on createLocalMembership$'s props.

src/state no longer refers to the widget API.

The conditionals around it mostly disappear: nullHostBridge's observables
are NEVER, so there is nothing to guard, and a request carries its own
reply rather than needing the transport and the original event.

CallViewModelWidget.test.ts drove hangup by emitting on the mocked
widget's action emitter, so it now injects a bridge instead, and checks
that the request is acknowledged.
2026-09-02 13:23:01 +02:00
Valere 6e44332fd1 Stop reading URL parameters from inside the call path
The view models reached for getUrlParams() — and so window.location —
from deep inside the call path: CallViewModel, MediaDevices, Publisher,
LocalMember and the footer view model. An embedded Element Call has no URL
of its own, so these values have to arrive as arguments instead.

Add the relevant options to CallViewModelOptions, to the MediaDevices and
Publisher constructors, to createLocalMembership$ and enterRTCSession, and
to createCallFooterViewModel. The remaining React consumers read the
context added in the previous commit. AppViewModel now takes its audio
output options too, moving that URL read out to main.tsx, where the app
shell can act as the adapter.

The new CallViewModelOptions fields are optional, defaulting to what the
URL parameters resolve to outside widget mode; the MediaDevices and
Publisher arguments are required, so that every construction site has to
be explicit.

useTheme.test.ts mocked the UrlParams module with a factory, so it needed
updating to mock the hook rather than getUrlParams.

No functional change.
2026-09-02 10:31:48 +02:00
Timo K. eefa6f843d fmt 2026-07-07 19:52:50 +02:00
Timo K. 3cc396f42c fix getChild before rageshake setup 2026-07-07 19:05:10 +02:00
Robin e77d143ce1 Clarify which Matrix-LiveKit members are remote
It was rather confusing that matrixLivekitMembers$ gives you objects of type RemoteMatrixLivekitMembers and yet the *local* member would often be among these. I've attempted to clear this up. To my knowledge this wasn't creating any bugs.
2026-06-18 12:10:32 +02:00
Timo K 00d6e034a0 fixup some missing yarn -> pnpm transitions 2026-04-21 10:53:56 +02:00
Timo K 2e26193c4a update leave 2026-02-05 06:33:51 +01:00
Timo K 42efc05bd0 Add more granular leave/join api 2026-02-05 06:06:15 +01:00
Timo K 927e8e195c add experimental label 2026-02-04 20:16:31 +01:00
Timo K 33f6271d13 sdk improvements - compatible with custom rtc application
- add local member
 - add optional make sticky
 - default to video not enabled
 - allow sending matrix events
2026-02-04 20:06:26 +01:00
Timo 97ee4630b0 Revert "[WIP] SDK target improvements" 2026-02-04 08:51:01 +01:00
Timo K 18b771e620 Allow sending room events in rtc sdk 2026-02-03 11:10:57 +01:00
Timo K 461a1f1b70 add to sending room messages 2026-01-31 12:29:56 +01:00
Timo K 92a4150d6d more/better logging 2026-01-26 15:43:07 +01:00
Timo K 02f1a0da82 add local member and rtcBackendIdentity to sdk target 2026-01-26 12:43:01 +01:00
Timo K 6d8ade073a use sessionManager with custom slot instead of only session. 2026-01-25 19:27:07 +01:00
Timo K 112420cb5b fix widget api appliaction capabilities 2026-01-25 14:24:52 +01:00
Timo K b754106feb Add widget.ts tests 2026-01-22 19:23:08 +01:00
Valere 7a8c2d6ca9 Merge branch 'livekit' into valere/initial_mute_states 2026-01-12 19:13:40 +01:00
Valere 56beb59346 review: Update copyright properly 2026-01-12 15:35:21 +01:00
Timo f444c9bc11 Merge pull request #3638 from element-hq/toger5/delayed-event-delegation
Pseudonomous identity and use the new jwt service endpoint (with delayed event delegation)
2026-01-09 19:58:30 +01:00
TimoandRobin 0b766472ed Update sdk/README.md
Co-authored-by: Robin <robin@robin.town>
2026-01-09 17:30:02 +01:00
Timo K 70b7ebff80 prettier 2026-01-09 16:32:14 +01:00
Timo K b7838e4353 Update README.md 2026-01-09 16:25:06 +01:00
Timo K 0eb0169ad9 update example 2026-01-09 16:01:03 +01:00
Valere d2907f51d3 prettier format 2026-01-09 12:35:25 +01:00
Valere a9153f2781 fix: Regression on default mutestate for voicecall + end-2-end tests 2026-01-09 12:03:56 +01:00
Timo 009c9e046c Merge branch 'livekit' into toger5/delayed-event-delegation 2026-01-05 21:26:15 +01:00
Timo K 5d5d75ebdf fixup merge 2026-01-05 21:08:33 +01:00
Robin 6aaf2db626 Fix formatting 2026-01-05 19:35:09 +01:00
Timo K 9bd7888fab copyright. 2025-12-23 12:48:54 +01:00
Timo K 852d2ee375 after merge cleanup 2025-12-22 13:35:40 +01:00
Timo K c1c73b0f02 lint 2025-12-11 15:04:07 +01:00
Timo K e4fee457cf allow to use custom applications 2025-12-08 09:41:01 +01:00
Timo K 8110d22c8b fix lint 2025-12-03 10:27:30 +01:00
Timo K 93de12d79c cleanup vite.configs and simplify exported sdk props. 2025-12-02 11:31:56 +01:00
Timo K f76a6cb599 cleanup unnecassary packages + add connected indicator 2025-12-01 20:39:40 +01:00
Timo K af47002613 Refactor local membership publisher and connectionState related logic 2025-12-01 20:14:29 +01:00
Timo K 1490359e4c cleanup changes godot->sdk add docs 2025-12-01 14:09:09 +01:00