Commit Graph

16 Commits

Author SHA1 Message Date
Timo
337d09cd4d Use the platform property for ios detection (#3360) 2025-06-24 14:25:05 +02:00
Timo
a507bcde90 Add onBackButtonPressed controls api (#3357)
* Add `onBackButtonPressed` controls api

* Update docs/controls.md

Co-authored-by: Robin <robin@robin.town>

---------

Co-authored-by: Robin <robin@robin.town>
2025-06-24 08:46:04 +00:00
Timo
a596eb71a9 add onAudioPlaybackStarted callback for controls (#3309)
* add onAudioTrackReady callback for controls

* more details in controls.md for `onAudioPlaybackStarted`
2025-06-10 12:35:04 +02:00
Timo
f0403c80bc also add non deprecated audio url parameter 2025-05-22 19:18:04 +02:00
Timo
fa0b5210fe Update docs/controls.md
Co-authored-by: Robin <robin@robin.town>
2025-05-22 19:07:47 +02:00
Timo
9f84a5cae0 Deprecate old naming and introduce new words 2025-05-22 18:58:18 +02:00
Timo
a056a28423 review 2025-05-21 12:53:17 +02:00
Timo
a1759a46de rename everything to controlledMediaDevices to make it consistent with the actual name in the url parameters (controlledOutput is now only used for the hook that provides the output handle) 2025-05-20 15:30:02 +02:00
Timo
7f4b0a33f6 isBluetooth -> isExternalHeadset 2025-05-16 17:06:54 +02:00
Timo
35963bbc9e Add flags to optimize EC device handling 2025-05-16 15:50:19 +02:00
Timo
acaf69ca1b add change audio button with callback on ios 2025-05-16 12:28:49 +02:00
Timo
2012b09845 review cleanup 2025-05-16 11:32:32 +02:00
Timo
610e792394 rename setOutputDevices-> setAvailableOutputDevices 2025-05-15 17:20:12 +02:00
Timo
f69c75322f add earpice mode 2025-05-14 19:55:08 +02:00
Robin
53adfa4497 WIP 2025-05-14 19:07:36 +02:00
Robin
3a754479dc Add simple global controls to put the call in picture-in-picture mode (#2573)
* Stop sharing state observables when the view model is destroyed

By default, observables running with shareReplay will continue running forever even if there are no subscribers. We need to stop them when the view model is destroyed to avoid memory leaks and other unintuitive behavior.

* Hydrate the call view model in a less hacky way

This ensures that only a single view model is created per call, unlike the previous solution which would create extra view models in strict mode which it was unable to dispose of. The other way was invalid because React gives us no way to reliably dispose of a resource created in the render phase. This is essentially a memory leak fix.

* Add simple global controls to put the call in picture-in-picture mode

Our web and mobile apps (will) all support putting calls into a picture-in-picture mode. However, it'd be nice to have a way of doing this that's more explicit than a breakpoint, because PiP views could in theory get fairly large. Specifically, on mobile, we want a way to do this that can tell you whether the call is ongoing, and that works even without the widget API (because we support SPA calls in the Element X apps…)

To this end, I've created a simple global "controls" API on the window. Right now it only has methods for controlling the picture-in-picture state, but in theory we can expand it to also control mute states, which is current possible via the widget API only.

* Fix footer appearing in large PiP views

* Add a method for whether you can enter picture-in-picture mode

* Have the controls emit booleans directly
2024-08-27 13:47:20 +02:00