Commit Graph

231 Commits

Author SHA1 Message Date
Ramón Souza
a60d817041 replace lodash debounce 2023-03-01 10:39:04 -03:00
Anton Georgiev
36b45c0824
Merge pull request #16172 from schrd/fix-issue-16171
fix: Only cache TURN Servers as long as credentials are valid and force firefox to use the turn server
2023-01-05 06:13:31 -05:00
Daniel Schreiber
74f37db4fa Get rid of forceRelayOnFirefox
Firefox has a buggy ICE implementation and needs WebRTC media traffic to
be routed through a turn server to work reliably with mediasoup.

Use the information fetched by the STUN API to determine if the operator
has configured a turn server. If there is one force firefox to use it.

Closes #16164
2022-12-18 23:17:14 +01:00
prlanzarin
0f9cc40549 fix(webcam): client crash due to undefined intl var 2022-10-27 16:25:13 +00:00
prlanzarin
341665e631 fix(webcam): client intermittently crashes when sharing camera
Under some specific scenarios, the virtual background restore code might
kick in _before_ the preloaded MediaStream is actually assigned to the
peer instance. That causes a crash because the peer attachment code
(where the vbg restore is triggered) tries to access the device ID of
said MediaStream - and it is undefined in the first place because it was
only being set in after the initial offer is generated which is an async
procedure.

This commit guarantees a preloaded stream is set before the peer is
flagged as created - so it's accessible by the attachment code.
It also checks whether there's a MediaStream available when trying to
restore VBGs to prevent undefined behaviors.
2022-10-27 16:25:06 +00:00
prlanzarin
0e162f1cda feat: configurable DSCP marking for WebRTC media
RTCRTPSender exposes DSCP marking via `networkPriority` in the encodings
configuration dictionaries. That should allow us to control
QoS priorities for different media streams, eg audio with higher network
priority than video. The only browser that implements that right
now is Chromium.

To use this, the public.app.media.networkPriorities configuration in
settings.yml. Audio, camera and screenshare priorities can be controlled
separately. For further info on the possible values, see:
  - https://www.w3.org/TR/webrtc-priority/
  - https://datatracker.ietf.org/doc/html/rfc8837#section-5
2022-08-15 21:24:05 +00:00
prlanzarin
d06ae5ce40 fix: add default gUM factory to new peer wrapper
For scenarios such as preview-less camera sharing, old echo test
2022-07-15 17:07:15 +00:00
prlanzarin
6a4ceac61f refactor(webcam): swap kurento-utils for the new peer wrapper 2022-07-15 14:00:12 +00:00
prlanzarin
029c957b22 fix(webcam): handle stream inactivation/gUM revocations
The 'inactive' event is fired whenever the stream gets inactive (ie it
cannot be used anymore), and there are scenarios where that is
unexpected behavior and must be handled accordingly.
The main example of that is when gUM permissions are revoked by the user
via the browser's permission management panel.
Since MediaStream/Track inactive events aren't being handled in such
scenarios, what actually happens is that the camera just freezes without
further indication why.

This commit handles those scenarios in both video-preview and
video-provider by:
  - 1) correctly stopping the camera (provider)
  - 2) surfacing a toast (provider) or error indication (preview)
2022-07-12 22:03:01 +00:00
prlanzarin
e93440e15a refactor(webcam): fix linter errors in BBBVideoStream 2022-07-12 17:50:16 +00:00
Joao Victor
a7e5869c91 feat(video): upload of own webcam virtual background 2022-05-10 14:17:16 -03:00
Lucas
2db9a1b343
Merge branch 'develop' into develop-bbb 2022-04-26 15:08:43 -03:00
Lucas Zawacki
83847a21aa Merge branch 'v2.5.x-release-Layouts' of github.com:lfzawacki/bigbluebutton into develop-bbb 2022-04-13 21:08:32 +00:00
prlanzarin
d6c7f23a0e feat(audio): local echo test and audio energy meter
New features:
  - A simplified echo test mode that only does a local loopback (instead of
  going to FS and back)
  - A volume meter for microphone streams to the AudioSettings view

Those two features are experimental and disabled by default; see
public.app.media.simplifiedEchoTest and public.app.media.showVolumeMeter configs

Collateral changes:
  - fix: localize fallback device strings in AudioSettings/DeviceSelector
  - Refactor on some media stream utils to be re-usable across components
  - Refactor in AudioSettings to keep gUM #uses stable.
    * TODO: need to pass streams through AudioManager to avoid the surplus gUM.
  - fix(audio): drop ScriptProcessorNode usage (deprecated)
    * Used in volume meter for tracking - use hark instead
2022-04-11 19:21:56 +00:00
Ramon Souza
1c873bd8d6 Merge remote-tracking branch 'upstream/v2.4.x-release' into merge-2425-apr08 2022-04-08 17:30:21 -03:00
Max Franke
e45deb5e7e refactor(video-list-item): hookify and reorganize component 2022-03-24 13:29:13 -03:00
prlanzarin
4ae5c70248 feat(video): add flag to disable quality change exemptions (floor, pin) 2022-03-14 11:58:53 -03:00
Lucas Zawacki
8d6931f656 feature(layout): Add focused camera to layout context 2022-02-24 14:22:00 -03:00
prlanzarin
17b8499ce4 fix(webcams): add extra error handling to pub/sub peer callbacks
video-provider is a race-condition prone mess and those callbacks were missing try-catches so eventual failures would bubble up as uncaught errors and not be logged properly

It`s worth mentioning that due to a number of tangential design failures in that component, 90% of the errors generate are, to the end user, invisible false positives. Thus: expect an increase in false-positive errors logs with this
2022-01-14 15:48:03 -03:00
Max Franke
7e2a3c3bca feat(webcams): client side implementation of webcam pin 2021-12-21 16:58:39 -03:00
prlanzarin
0ac4148f80 fix(webcams): keep base peer object in component, fix viewers randomly failing
The base peer object reference was moved from the component to service for _reasons_

That caused an issue where the component lifecycle would mess up that
centralized reference dictionary on certain conditions. That could cause viewing
sessions to fail intermittently

This reverts the location of the base dictionary reference back to
video-provider/component
2021-12-16 12:13:20 -03:00
prlanzarin
67ec798758 feat(webcams): preserve floor holder's original camera profile 2021-12-08 22:53:16 +00:00
prlanzarin
da6ab02122 chore: add forceRelayOnFirefox option (false by default)
- forceRelayOnFirefox: whether TURN/relay usage should be forced to work
around Firefox's lack of support for regular nomination when dealing with
ICE-litee peers (e.g.: mediasoup).
  * See: https://bugzilla.mozilla.org/show_bug.cgi?id=1034964
- iOS endpoints are ignored from the trigger because _all_ iOS browsers
  are either native WebKit or WKWebView based (so they shouldn't be affected)
2021-11-30 20:31:12 +00:00
João Victor
6524f70941 support for storing multiple virtual backgrounds 2021-11-19 08:10:24 -03:00
Joao Victor
77c32a6391 fix: virtual background not kept when switching from breakout to main room 2021-11-11 11:33:55 -03:00
prlanzarin
1cb412529d feat(webrtc): add EXPERIMENTAL option to disable ICE candidate signaling
ICE lite servers (eg mediasoup) dont need candidates signaled out-of-band; neither does KMS in certain scenarios

Disable their signaling saves us some ticks in bbb-webrtc-sfu and some bandwidth all around
2021-09-24 17:24:06 +00:00
Anton Georgiev
b0fc38ef42
Merge pull request #13131 from prlanzarin/u24-tapowerline
fix(webcams): check for component state after peer creation
2021-09-02 10:15:18 -04:00
prlanzarin
a7d549d1e3 fix(webcams): check for component state after peer creation
There could be a race condition where a peer creation (async) would resolve after the provider was unmounted

That would lead to a state inconsistency which could generate all sorts of cryptic problems
2021-09-01 19:13:22 +00:00
Ramon Souza
5679710e7d restore video-provider state and add comment about why it is needed 2021-09-01 09:23:39 -03:00
Ramon Souza
084d80f23e remove unused state properties 2021-09-01 08:48:46 -03:00
prlanzarin
c741cea715 feat(video): add media server adapter config for cameras in bbb-html5
Allows configuring, via bbb-html5, which media server adapter will be used by cameras; server wide
2021-08-31 00:30:06 +00:00
Anton Georgiev
4ecb24b4fa Merge branch 'v2.3.x-release' of github.com:bigbluebutton/bigbluebutton into merge-aug30 2021-08-30 18:11:16 +00:00
Mario Jr
631e8fce4b Get stats for video connection
We now retrieve update information about active video peers, and calculates
download and upload rates. These rates are the sum of data transfered in
all video peers.
Screenshare stats is not being added to the sum, yet.
2021-08-13 17:24:44 -03:00
prlanzarin
74c6f1b6f8 refactor(webcams): let the server generate subscriber offers
Let the server generate subscriber offers so that it becomes easier for us to
do payload type normalization between publishers and subscribers

Also split peer creation for pubs and subs into separate methods for clarity
2021-08-10 17:31:45 +00:00
prlanzarin
b190f74009 refactor(virtual-backgrounds): remove camera effect toggle (video-list) 2021-07-28 13:37:40 +00:00
Anton Georgiev
a37843d2a7 Merge branch 'v2.3.x-release' of github.com:bigbluebutton/bigbluebutton into merge238-into-24 2021-07-23 17:09:18 +00:00
prlanzarin
8b48de561b fix(webcams): avoid leaving dangling HTMLMediaElements in paused state
Should fix an issue with the recent Chrome 92 intervention that limits
the number of concurrent WebMediaPlayers (an inner element of
HTMLMediaElements) to 75/40.

Webcam video elements were being left dangling in paused state despite
the elements themselves being cleaned up from the component. That
generated a skewed accounting of WebMediaPlayers in the session.
2021-07-23 02:24:47 +00:00
prlanzarin
9071ba8bc4 refactor(virtual-backgrounds): re-organize virtual background code
Changes (maybe not a complete list):
  - Disable virtualbgs by default
  - Move the virtualbg selector in video-preview to the side below the
profile selection
  - Restore old video-preview sizes
  - Add a wrapper class for MediaStreams (BBBVideoStream)
  - Centralize virtualbg services and business logic code into BBBVideoStream
  - Refactor and centralize virtualbg constant fetching
  - Refactor and centralize virtualbg config fetching
  - Organize virtualbg type definitions
  - Remove added states in video-provider to prevent further bloat
  - Remove added states in video-preview to prevent further bloat
  - Lock virtual bg switching while video-preview itself is locked
  - Add proper virtualbg error surfacing via toasts
  - Refactor iOS availability detection to use centralized UA checker
  - Avoid calling gUM when toggling virtualbgs on/off
  - Make virtualbg video-list-item action a toggle instead of a
state-aware action
  - Make virtualbg switching work in video-preview for cameras that are
already shared. Especially useful when there are multiple source
cameras, and will be important in the near future
  - Add Derivative Work notices in files that are partially copied from
jitsi-meet
  - Simplify track replacing in video-provider
  - Split video-preview UI code for virtualbgs into a separate functional component
2021-07-22 18:53:42 +00:00
Bartu Bazna
9f791a8892 Squashed virtual background commits 2021-07-21 20:00:19 +00:00
prlanzarin
15bd0b6087 fix(webcams): add error feedback when media is ejected by the server
Closes #12732
2021-07-08 15:10:22 +00:00
prlanzarin
0453e9e842 fix(webcams): reduce number of gUM calls
Shave off the number of calls in video-preview and video-provider by
using a stream storage

We don´t call an upfront gUM in video-preview anymore to lift the
fingerprinting barrier on device labels and IDs. Flow has been reversed:
upfront enumerate, load first preview, then check if previous
enumeration was obfuscated.

Add a stream storage in video-preview`s service to avoid re-fetching
them in video-providerj

Remove some unneeded video-preview container props

Improve some of video-preview`s error locales
2021-07-02 16:13:31 +00:00
Vitor Mateus De Almeida
3a281adab5 Remove background and commented code
Revert linting
2021-06-22 14:04:56 -03:00
Vitor Mateus De Almeida
6469b68d45 Add webcams component on new Layout Manager 2021-06-21 17:16:59 -03:00
Pedro Beschorner Marin
068b82b1fa refactor(connection status): remove legacy monitor
Remove parts of a previous connection monitor.

To add some context (as far as my memory goes) to the multiple connection
monitor features the product has, `stats` (currently named `connection status`)
was introduced at the Flash client back in ~2016. @fcecagno and I did it
as a BigBlueButton's Summit activity. Our work was squashed into a single
commit in 92554f8b3e :).

I'm not sure about the whole story behind `network information` (the late
connection monitor added to the HTML5 client) but I assume it should work
as a collector for a bunch of different connectivity monitors. I remember
when it was introduced but I don't know why it wasn't adopted. My best guess
would be because of some performance issues the `user list` had back then.

To follow on why `connection status` replaced `network information` at the
HTML5 client, when I did the `multiple webcams` feature I had to refactor
a big chunk of the `video provider` (#8374). Something that wasn't really
helping there was the adaptation of `stats` that was made to show local
feedback for each webcam connection. Although this feature wasn't being
used anymore, `network information` did rely on that to build up data. With
this monitor gone I assumed it was my responsibility to provide an alternative
so I promoted Mconf's port of the Flash `stats` monitor to BigBlueButton's
HTML5 client (#8579).

Well, that's my perspective on how things went for those features. If
anyone would like to correct me on something or add something else on
that history I would appreciate to know.
2021-06-13 14:02:46 -03:00
prlanzarin
d707048c56 fix(video): remove unused floorStream variable 2021-05-12 19:26:26 +00:00
prlanzarin
001ab9554c video: added voice activity stream sorting, made stream sorting extensible
Video streams can be sorted by voice floor activity in the client according to FreeSWITCH´s floor events. The feature works together with pagination, essentially giving an Last-N like experience while not disrupting too much

Made video stream sorting extensible in a way. The sorting modes for pagination and unbounded can be configured in settings.yml and new sorting modes can be added to the stream sorting util under video-provider. Inline docs explain how to do that

Changed how the stream ID attribute from video-streams collection was passed to downstream components; we had an array map that was executed every change just to map stream to cameraId, which is bizarre. So I changed the cameraId usage in downstream components to be conformat with the collection attributes and shaved off the map where it wasnt needed

Add better selectors to video-list-item container´s VoiceUser fetch
2021-04-12 19:06:07 +00:00
prlanzarin
ab17b10c38 listenonly,video-provider,screenshare: remove ICE gathering pre-flight check 2021-03-12 02:51:45 +00:00
prlanzarin
db15d1b280 video-provider: fix setReconnectionTimeout race condition that caused webcams to drop
Problem: setReconnectionTimeout was being called in the first candidate generation to set the negotiation/reconnection timeout up. That caused some browsers or specific scenarios (mainly envs without STUN) to establish the negotiation (playStart) before generating any useful out-of-band candidates (relay). That would cause the timeout to be set AFTER it is supposed to be cleared due to success (playStart), making the webcam drop after a while

So I moved the setReconnectionTimeout call to a safer spot: right after the first negotiation requisition goes out to bbb-webrtc-sfu
2021-03-10 20:09:55 +00:00
prlanzarin
6418d0f556 video-provider: more logging improvements, clean up playStart restart timers reset 2021-03-10 20:09:00 +00:00
prlanzarin
f85b5dfa5b video-provider: quick logging cleanup
Reduce logging volume and payload size, perf
2021-03-10 20:08:40 +00:00