2272 Commits
Author SHA1 Message Date
Timo 5332970dcf add onAudioTrackReady callback for controls 2025-06-05 19:00:08 +02:00
Timo 9ff6bcb583 Use html audio element to call setsink id for reactions and call sounds. 2025-06-05 18:59:37 +02:00
Robin 45fd7fdc7f Always render audio from the current set of participants
We forgot to tell React that we need the audio renderer to react to changes in the set of MatrixRTC participants; instead we had it referencing rtcSession.memberships non-reactively.

Now, I'm not 100% confident that this is going to fix the "speaking from the void" issues observed in the wild, because I can't reproduce them and, in my testing, the InCallView component always seemed to be rendered redundantly when the MatrixRTC participants change, even though we hadn't explicitly stated that it needs to react. (This makes sense as we haven't memoized the component.) But it's worth a shot.
2025-06-05 18:59:25 +02:00
Robin 047b3ffded Avoid reactivity bugs in how we track external state (#3316)
* Avoid reactivity bugs in how we track external state

Many of our hooks which attempt to bridge external state from an EventEmitter or EventTarget into React had subtle bugs which could cause them to fail to react to certain updates. The conditions necessary for triggering these bugs are explained by the tests that I've included.

In the majority of cases, I don't think we were triggering these bugs in practice. They could've become problems if we refactored our components in certain ways. The one concrete case I'm aware of in which we actually triggered such a bug was the race condition with the useRoomEncryptionSystem shared secret logic (addressed by a1110af6d5).

But, particularly with all the weird reactivity issues we're debugging this week, I think we need to eliminate the possibility that any of the bugs in these hooks are the cause of our current headaches.

* Reuse useTypedEventEmitterState in useLocalStorage

* Fix type error
2025-06-05 18:59:08 +02:00
Robin a9ab93304a Ignore spurious 'devicechange' events
This gives us the additional insurance of breaking the Safari media acquisition loop at the source by admitting that they can be spurious in practice. Safari, why!?
2025-06-05 18:55:44 +02:00
Robin 8b75a266ea Break loop in acquiring media on Safari 2025-06-05 18:55:35 +02:00
Timo 87f02b28a5 Merge pull request #3293 from element-hq/toger5/more-disconnect-logging (#3297)
Fix creating two lk rooms if there is no local store setup (fixes a resulting disconnect bug)
2025-05-28 09:07:50 +02:00
TimoandRobin 8f424452fc Disable device switching when in controlled audio devices mode (#3290)
* Disable device switching when in controlled audio devices mode

* Temporarily switch matrix-js-sdk to robin/embedded-no-update-state

To allow us to test this change on Element X, which does not yet support the update_state action.

* Also add a check for controlled audio devices in useAudioContext

* use develop branch

* fix tests

---------

Co-authored-by: Robin <robin@robin.town>
2025-05-23 17:55:28 +02:00
Robin 52895ed599 Audio device controls for mobile native audio device selection
Backport of 0971a15c40.
2025-05-22 14:11:46 -04:00
Timo 28246ef86b Update RTCSession configuration to non deprecated names. (#3267)
* Update RTCSession configuration to non deprecated names.

* bump js-sdk

* es2024 and array buffer adaptions

* Alternative without `createKeyMaterialFromBuffer`
2025-05-19 18:04:07 +02:00
Timo b5fe55aef2 Add custom audio renderer for iPhone earpiece and only render joined participants (#3249)
* Add custom audio renderer to only render joined participants & add ios earpice workaround

fix left right to match chromium + safari
(firefox is swapped)

earpice as setting

Simpler code and documentation
The doc explains, what this class actually does and why it is so complicated.

Signed-off-by: Timo K <toger5@hotmail.de>

use only one audioContext, remove (non working) standby fallback

* Add tests

* use optional audio context and effect to initiate it + review
2025-05-15 20:46:39 +02:00
Valere FedronicandTimo 86d80630c1 Fix connection leaks: Ensure that any pending connection open are cancelled/undo when ActiveCall is unmounted (#3255)
* Better logs for connection/component lifecycle

* fix: `AudioCaptureOptions` was causing un-necessary effect render

AudioCaptureOptions was a different object but with same internal values, use directly deviceId so that Object.is works properly

* fix: Livekit openned connection leaks

* review: rename to AbortHandles

* review: rename variable

---------

Co-authored-by: Timo <toger5@hotmail.de>
2025-05-14 18:41:22 +02:00
Valere FedronicandTimo 1ff2fb3fff only show to-device transport label in dev mode (#3221)
* Only show to device encryption label if developer mode on

* Add tests for developer mode to device label

---------

Co-authored-by: Timo <toger5@hotmail.de>
2025-05-13 22:22:56 +02:00
Timo e6710f72e3 Fix to-device encryption info label (#3208)
* Fix to-device encryption info label
The label was shown also without checking that we use PerParticipantE2EE. Which is a prerequisite for toDevice transport. As a result the label was shown when not desired.

* rename: useLiveKit -> useLivekit

* make the settings naming consistent
2025-05-13 22:05:55 +02:00
Timo 04bc6c77a3 developer option to mute all audio (#3239) 2025-05-13 21:11:12 +02:00
Robin 9f727b904b Remove patched version of WebCodecs types
The patch has now been upstreamed to @types/dom-webcodecs.
2025-05-09 10:48:09 -04:00
Quentin Gliech 380880137e Keep the HTML lang attribute in sync with the i18next language (#3247) 2025-05-05 17:12:00 +02:00
Robin eeb3a1a991 Add license notices to inlined type declarations 2025-04-29 22:19:00 +02:00
Robin 9df0f58117 Inline a patched version of WebCodecs types 2025-04-29 12:07:16 +02:00
Robin 8f1761442b Fix tests 2025-04-28 16:37:53 +02:00
Robin 7d0117903e Don't lie about the type of the video track 2025-04-28 16:01:34 +02:00
Robin cd9035b5fc Make background blurring actually react to track restarts 2025-04-28 16:00:03 +02:00
Robin 02ce1f701a Document the background transformer a bit better 2025-04-28 15:59:32 +02:00
Robin e88e0b1901 Import the segmenter model in a more statically-analyzable way 2025-04-28 15:58:50 +02:00
Robin 31032994a5 Merge branch 'livekit' into toger5/track-processor-blur 2025-04-25 17:23:20 +02:00
Timo a1d6eef12a Set ratchetWindowSize to > 0 enable rachet compatibility. (#3224) 2025-04-23 09:22:54 +02:00
Timo 78a41c09de Fix MatrixRTC js-sdk logs in rageshakes (#3226) 2025-04-22 21:24:09 +02:00
Robin 3fc4cc908e Cleanup + use a better check for blurring support 2025-04-22 19:20:43 +02:00
Robin 63ad4a3ad3 Get blurring working again 2025-04-22 18:32:01 +02:00
Robin 3243afd061 Merge branch 'livekit' into toger5/track-processor-blur 2025-04-18 12:32:03 +02:00
Timo 770b94eb44 Add RoomAndToDeviceKeyTransport and enable as default. (#3185) 2025-04-11 17:05:57 +02:00
Timo 3c0d81844f Add option to enable to-device-encryption (#3167)
* enable to-device-encryption

* add logging for key provider

* make rooms encrypted

* add dev setting to choose to-device or room encryption

* add indicator when to-device is used.
2025-04-11 10:07:50 +02:00
Timo 75933a508c Merge branch 'livekit' into toger5/track-processor-blur 2025-04-05 00:00:00 +02:00
bc0ea20343 Default vite config to support using local build of crypto wasm (#3038)
* Devex: Default vite config to support using local build of crypto wasm

* use realpathSync and make it work with linked and not-linked
We need to use sync because an async defineConfig fails for the embedded exports.

* also allow just linking matrix-sdk-crypto-wasm (without js-sdk linking)
---------

Co-authored-by: Timo <toger5@hotmail.de>
Co-authored-by: Timo <16718859+toger5@users.noreply.github.com>
Co-authored-by: Robin <robin@robin.town>
2025-04-04 23:24:42 +02:00
Valere f0126f41fb Widget: Add missing to device permission for encryption keys 2025-04-04 09:32:34 +02:00
Hugh Nimmo-Smith d1753c33f5 Use correct rageshake URL when running in embedded package + tests (#3132)
* Use correct rageshake URL when running in embedded package

It was incorrectly trying to use the one from config.json

* Refactor to add tests

* Empty mock config
2025-03-31 16:38:25 +01:00
Timo 2073cd3ac1 Rename EULA to SSLA (#3135)
* Change EULA to SSLA
 - rename i18n fields
 - update the config property to `ssla` and deprecate `eula`
 - use `eula` instead of ssla in case it is provided in the config.

* fix default config

* completely remove eula fallback
2025-03-31 14:18:45 +02:00
Hugh Nimmo-Smith bfd4bb2ec1 Show URL params and environment variables in developer tab (#3134) 2025-03-27 16:35:31 -04:00
Robin aab4efe03a Use type imports consistently 2025-03-27 16:09:59 -04:00
Robin eb18cbef78 Consolidate imports 2025-03-27 16:04:03 -04:00
Robin ae339ea5cc Fix formatting issues 2025-03-27 14:47:01 -04:00
Robin 33700d1529 Merge branch 'livekit' into toger5/src-to-lib-import 2025-03-27 14:35:08 -04:00
Robin f99eb3c88f Merge branch 'livekit' into robin/berry 2025-03-27 14:07:24 -04:00
Robin 0ed1564d3e Merge branch 'livekit' into robin/posthog-logout 2025-03-24 10:10:28 -04:00
Robin cd5ecb2352 Rename error boundary hook
It doesn't check whether it's actually used inside a GroupCallErrorBoundary, and it's generally useful for interacting with any error boundary, so I'm giving it a generic name to reflect this.
2025-03-21 15:17:41 -04:00
Robin 9a5dd10e27 Show errors that occur in GroupCallView using the error boundary
We were previously using the useGroupCallErrorBoundary hook to surface errors that happened during joining, but because that part is outside the GroupCallErrorBoundary it just ended up sending them to the app-level error boundary where they got displayed with a more generic message.
2025-03-21 14:59:27 -04:00
Hugh Nimmo-Smith 9bf046b714 Merge branch 'livekit' into robin/berry 2025-03-21 17:14:10 +00:00
Hugh Nimmo-Smith 6043b3949b Analytics configuration is the responsibility of the host application when running in widget mode (#3089)
* Support for analytics configuration via URL parameters in widget mode

Adds:

- posthogApiHost
- posthogApiKey
- rageshakeSubmitUrl
- sentryDsn
- sentryEnvironment

Deprecate analyticsId and use posthogUserId instead

* Partial test coverage

* Simplify tests

* More tests

* Lint

* Split embedded only parameters into own section for clarity

* Update docs/url-params.md

* Update docs/url-params.md

* Update vite.config.js
2025-03-21 11:15:20 +01:00
Valere fd20ac4022 Merge branch 'livekit' into valere/async_error_show_boundary 2025-03-19 09:30:16 +01:00
Robin 45c3c7a37e Show "insufficient capacity" when hitting participant limits 2025-03-18 13:33:36 -04:00