by fixing the cause rather than the symptom: this upgrades the code to use the new, recommended JSX transform mode of React 17+, which no longer requires you to import React manually just to write JSX.
Calls are an environment with high cognitive load, so it's important that we keep extra UI elements like these to a minimum and stick to what's been explicitly designed. I assume that this was here as a developer feature to diagnose reliability of the back end components, which is perfectly fine, so I've kept it behind a developer setting rather than fully removing it.
* respect mute state set in lobby for call
Signed-off-by: Timo K <toger5@hotmail.de>
* move device from lobby to call
Signed-off-by: Timo K <toger5@hotmail.de>
* save device in local storage
Signed-off-by: Timo K <toger5@hotmail.de>
* local storage + fixes
Signed-off-by: Timo K <toger5@hotmail.de>
* device permissions
Signed-off-by: Timo K <toger5@hotmail.de>
---------
Signed-off-by: Timo K <toger5@hotmail.de>
This version is not supposed to properly work, this is a work in
progress.
Main changes:
* Completely removed the PTT logic (for simplicity, it could be
introduced later).
* Abstracted away the work with the media devices.
* Defined confined interfaces of the affected components so that they
only get the data that they need without importing Matris JS SDK or
LiveKit SDK, so that we can exchange their "backend" at any time.
* Started using JS/TS SDK from LiveKit as well as their React SDK to
define the state of the local media devices and local streams.
This one is gonna take some explaining:
When in resist fingerprinting mode, Firefox exhibits some funny behavior: when we ask for the the list of media devices, it gives us fake device IDs. But when the js-sdk requests a stream for any of those devices, Firefox associates the stream with the real device ID.
Now, in order to get the names of devices included in their metadata when you query the device list, you need to be holding a stream. For this reason, useMediaHandler was set up to reload the device list whenever matrix-js-sdk got a new local stream. But because of the inconsistency in device IDs, it would enter an infinite cycle telling matrix-js-sdk to request a stream for the fake device ID, but with matrix-js-sdk always responding with the real device ID.
I already wasn't happy with useMediaHandler's use of @ts-ignore comments to inspect private js-sdk fields, and in the meantime we've come up with a simpler function for requesting device names, so I decided to refactor useMediaHandler to use it instead. Importantly, it doesn't break in resist fingerprinting mode.
This created a new UX issue though: now, when on the lobby screen, useMediaHandler would request microphone access so it could get device names, followed immediately by a *second* pop-up for the lobby screen to request camera access. That's 1 pop-up too many, so I changed useMediaHandler to only request device names when a component is mounted that actually wants to show them. Currently, the settings modal is the only such component, and users normally only open it *after* granting full audio/video access, so this solution works out quite nicely.
* interceptor: add MediaStream feed debug interceptor
- interceptor displays nick name for default and nick name + user id if user gast
- interceptor displays track id + media stream ids
Rather than every 30 seconds. This way we'll save logs for sessions
lasting less than 30 seconds which we previously didn't. Also save
on window unload just in case that doesn't catch everything.
Plus remove some more unused params.
* Remove duplicate copyright header
* Remove ts-ignores by just using the objects directly rather than via
event.target
* Use error.message rather than errorCode which TS doesn't know about
and may or may not exist.
* Remove some unused things like the skip rageshake function and
the option to init rageshakes without storage.
* Turn single function with a boolean param to make it take two entirely
separate code paths into two functions.
This is an Element project (in the vector-im repo) so the Copyright
should be for New Vector: it was incorrectly attributed to the
foundation for some files (and some files were missing headers).
We only ever used the static instance() method to get to the config
object, so just make a static instance that returns the ConfigOptions
directly, throwing an exception if it's not yet initialised. This way
the types can all be non-optional (plus it's shorter).
* load analytics id from url in embedded mode
Signed-off-by: Timo K <timok@element.io>
* add start call in the widget code path
Signed-off-by: Timo K <timok@element.io>
* send group call id instead of call name
Signed-off-by: Timo K <timok@element.io>
* generate analyticsid based on account analyticsid
This make it impossible to find users from the element web posthog instance
in the element call instance
* move registration type setup PosthogAnalytics.ts
* Order identificaition and tracking.
This fixes an issue that the widget version did not identify the user before sneding
the first track event.
Because start call is called right after app startup.
Signed-off-by: Timo K <timok@element.io>
Hopefully explained in comment: we have a heisenbug where we sometimes
lack audio from a certain participant, so this simplifies the audio
path by removing the workaround required to do AEC with spatial audio
on chrome.