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.
* 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
As per comment
Unsure if this is the best fix - ideally we wouldn't go into no-controls
mode at all, but this part doesn't know whether the dialog is open so
the only thing we could really do is tweak the threshold, or possibly
guess based on width instead?
We called the 'unhold' function even if the button wasn't held which
probably will have been generating unmute events even when we weren't
muted.
Also use separate handlers for events so we can have specific log lines
(and also see where the event comes from when caught in the debugger).
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.
As per comment, we can't use workers in Vite dev mode. We previously
fell back to the memory store but this ends up with it working significantly
differently in dev mode to production, eg. dev mode would always start
by doing an initial sync, so old to-device messages would arrive again.
There's no need to fall all the way back to the memory store though,
we can use the IndexedDB store without the worker.
Since the app already determines when someone is speaking, we can use that information to make it less obvious when to-device messages are being slow to deliver mute state updates.