Video provider's service for local stream control was wrongly setting the disconnected
state when a multiple webcam user tried to stop a single cam. The `stopVideo` method
was inconsistent when called multiple times for the same `cameraId`.
Included a better testing scope for event dispatching and disconnected state handling.
Some browsers seem to (occasionally) not return the getUserMedia promise call and the
user gets stuck in this state unable to share her/his webcam.
Since enumerateDevices still works even on a gUM rejection this includes a racing
timeout that skips gUM. Configured at settings `gUMTimeout`.
Reproduced with Windows 10 Chrome 87.
The first getUserMedia was not supposed to be considered critical to the whole
video preview flow.
Scenarios where the user has multiple media sources and one of them was already
in use or had some malfunction problem were forcing a global skip at the video
preview modal even if one of them was available to be used.
BigBlueButton already allows mirroring the users own webcam as a global
setting set by administrators. Users have no way of choosing this on
their own.
This patch turns this functionality into a user setting for all webcams.
Every camera menu now gets a “mirror” entry.
The global setting is still used as a default value, keeping the current
behavior as it is to not confuse users.
This is a very simple patch improving the support for 16x9 cameras.
In mixed mode – if 4x3 and 16x9 cameras are present – everything looks
like it did before but if only 16x9 (or wider) cameras are present,
BigBlueButton will drop the letter boxes and show a 16x9 video
container.
This happens because FreeSWITCH is not able to parse the "From" header when it has multiple occurrences of ':'. So user is not able to join audio.
To fix, we now changed the "callerId" to use the base64 value of the user name, instead of directly using user's input (the callerId format keeps being a triple like this: <user_id>-bbbID-<base64_encoded_name>).
Once this callerIdName is encoded at the same point it is generated, there shouldn't be server side effects for changing this value; except for those places where the callerName is retrieved by splitting this triple (such as the voice talking-indicator, as described below).
Updated the talking-indicator to retrieve the username from User's object, instead of retrieving from the one username generated by splitting the callerId triple.
This problem also happens in versions <= 2.2.26.
When user joins audio and for some reason an error (such as 1001, 1002,...), happens, the user is not able to click "Mic" and "Listen Only Buttons"; except if the audio window is closed and oppened again.
When getting disconnected with 1001 ("websocket closed unexpectedly" error) we were creating a new SIP session, therefore a new FreeSWITCH channel.
While reconnecting the socket, instead of closing the SIP session, we keep it alive during reconnection (audio should keep working in the meantime). When reconnected we keep using this same session (avoiding the creation of an extra one).
We also better handle WebSocket error codes from SIP.js.
FF immediately closes websocket when unloading page, so we now to stop user agent when 'beforeunload' event is triggered, to avoid leaving open sessions in FreeSWITCH when user leaves page.
Cursor coordinates are calculated using the presentation SVG object
DOMMatrix. When getting this matrix, some browsers (Firefox at least)
responds it as null if the svg object does not have a visible area.
This adds a check before trying to transform the cursor coordinates
using the matrix inverse so we avoid calling a method from a null object.
If there isn't a DOMMatrix to be used as reference, returns a simple out of
bounds SVGPoint (-1, -1)
Users must return their audio to the main room before joining a different one.
Since the audio transfer and the UI state manager doesn't provide a shortcut for
jumping from a breakout room to another, avoid making this opiton available.
When refusing ("thumbs down" button) echo test, user is able to select a different input device. This should work fine for chrome, firefox and safari (once user grants permission when asked by html5client).
For output devices, we depend on setSinkId function, which is enabled by default on current chrome release (2020) but not in Firefox (user needs to enable "setSinkId in about:config page). This implementation is listed as (?) in MDN.
In other words, output device selection should work out of the box for chrome, only.
When selecting an outputDevice, all alert sounds (hangup, screenshare , polling, etc) also goes to the same output device.
This solves #10592