fix(screenshare): stop using exact for specified device sharing (#1031)
Overconstrainederror occurs when calling gum with "exact"
when on URLs with a hash. To get around this, remove
"exact". Add handling for specified device not being
found, as we can no longer rely on "exact". This
still leaves open the possibility of the wrong
camera being accessed.
We had several reports that googSuspendBelowMinBitrate misbehaves, we had been running for a while with that disabled for the bridge, but it was causing problems and for p2p.
* fix(permissions): remove space from requesting camera
Chrome errors on querying permissions with "camera "
because it does not match an expected enum.
* fix(permissions): check value of returned PermissionStatus
A permissions query returns an object with a status/status
of whether or not permission has been granted. Check that
value in addition to the existence of the object.
* fix(permissions): prevent permission being set to undefined
* ref(permissions): move permissions strings to constants
fix(screenshare): specify source type for fake and proxy (#878)
Spot is the consumer of screensharing using a camera
input and through a proxy connection. To differentiate
which one is active, declare a source type on the
created "desktop" stream.
fix(screenshare): do not limit resolution for fake screenshare (#877)
A camera source can be used as a screenshare source.
Normally for screenshare resolution is not capped and
the same will be true for the fake screenshare source.
feat(screenshare): use camera as a screenshare source
This feature is intended for spot. Spot can have an
HDMI -> usb adapter hooked up to it. In that case,
attempting to screenshare should use that adapter
as a screensharing source.
fix(RTC): Pass options allowing GUM to work with config.
The 'options' identifier is used for different objects, which has lead to a bug where
the object that passes along the 'config.js' provided data is lost along the way. Code
that's further down the execution stack still expects to process that configuration,
which indicates that not passing it along is unintentional.
With this change, an Android device will adhere to the value defined in the 'resolution'
value of config.js, something it currently does not.
The code for handling device availability has been disabled for a long time,
plus it's ill named since it represents 2 abstractions: lack of permissions and
lack of devices.
Time for it to rest in the git graveyard.
fix(device-list): workaround for devicechange being fired twice
Chrome fires devicechange twice. This causes the DEVICE_LIST_CHANGED
event to fire twice. The listener in jitsi-meet has async logic
to handle the event, including creation of new tracks. So it
can happen that two devicechange events fire, the jitsi-meet
listener fires twice, creates duplicate tracks, and uses both
tracks. Diffing the device list for an actual change is a workaround
against extra devicechange events.
Note: this does not solve the issue in jitsi-meet of it not
handling quick successive DEVICE_LIST_CHANGED events.
Get rid of all wrappers and use navigator.mediaDevices.getUserMedia, since all
supported platforms have it by now.
Also use the unprefixed versions of WebRTC APIs.
* Enables adapter for edge.
We were not filtering correctly all unsupported iceServers and an error is thrown and no connection is established.
* Enable desktop sharing for Edge.
Currently when replacing video track with desktop sharing one, doesn't work because of: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/17528460/
If Edge user joins first and enables desktop sharing it will work when others join. Tried also to use replaceTrack/setTrack as a workaround, but again we hit an error, this time InvalidAccessError.
* Adds the helper function usesAdapter in BrowserCaps.
core: refactor initialization not to return a Promise (continued)
1. The example was using the Promise return value of JitsiMeetJS.init
which is no longer possible/correct after commit "core: refactor
initialization not to return a Promise".
2. We went back and forth with the value returned by JitsiMeetJS.init:
we initially didn't return a value, then we started returning a Promise,
and now we're not returning a value. Whether we'll go back to returning
a value is up in the air. Anyway, the return value is practically
determined by the last in a chain of function calls: JitsiMeetJS, RTC,
RTCUtil. Since the chain is not really documented, it will not hurt much
to make it easier to refactor the chain by "composing" the functions.
core: refactor initialization not to return a Promise
There is nothing asynchronous about the initialization process (anymore), thus
turn it into a synchronous method.
In addition, WebRTC support is absolute, it cannot change from not being
supported to being supported (as it plreviously could, thanks to Temasys) so get
rid of the ancillary logic to support that.
Last, introduce a way to check if WebRTC is supported in the current
environment: JitsiMeetJS.isWebRtcSupported().
Switches camera id to mandatory when using old gum flow. (#731)
* Switches camera id to mandatory when using old gum flow.
When it fails we retry with different resolutions, and if that doesn't work we remove device id and let gum to decide which device to use.
* Fixes comments.
* fix(SS): Set min and max frame rate to 5
* fix(SS): Set min and max frame rate for the new GUM flow.
* feat(ss_framerate): Add config option for min/max frame rate.
* doc(RTCUtils): Fix params format.
* fix(SS_framerate): Don't pass undefined constraints.
* fix(SS_constraints): Handle chromeMediaSourceId === undefined.
ref(gum): try to reduce complexity of obtainAudioAndVideoPermissions (#707)
* ref(gum): try to reduce complexity of obtainAudioAndVideoPermissions
Even though I walk through the valley of the shadow of death
I will fear no evil... Reduce indenting and repeated calls to
getting desktop streams by creating a promise chain.
* squash: use arrow func
* squash: move constructor support to helper
* squash: put ff into mediastream constructor check
* squash: ff support media stream constructor
MDN states its been supported since 44. ESR is currently
52.
* squash: rename dsoptions, constant defaults
* squash: move comment about missing tracks error handling
* squash: wrap getUserMediaWithConstraints in promise
* squash: split up av funcs
* squash: hey, some tests...are better than no tests?
* wip: initial version of the new AnalyticsAdapter.
* ref: Restructures the ICE duration and state change events.
* ref: Restructures the JitsiLocalTrack events.
* ref: Restructures the TTFM events.
* ref: Updates the user feedback event.
* ref: Restructures the _CONNECTION_TIMES_ and TTFM events.
* ref: Restructures the BRIDGE_DOWN and NO_DATA_FROM_SOURCE events.
* ref: Restructures the FOCUS_LEFT event.
* ref: Restructures the DATA_CHANNEL_OPEN event.
* ref: Removes the ICE_FAILED event (it is a duplicate of a state change event).
* ref: Restructures the device list events.
Uses one event per device, since the new format does not allow non-atomic attributes.
* fix: Does not obey "unmute" commands from the focus.
* ref: Restructures the "remotely muted" event.
* ref: Restructures the CONFERENCE_ERROR events.
* ref: Removes the CONNECTION_INTERRUPTED event
We can use ICE_STATE_CHANGED instead.
* ref: Renames isreconnect to isReconnect.
* ref: Removes the CONNECTION_RESTORED event. Use ICE state changes instead.
* ref: Restructures the p2p events.
* ref: Restructures the jingle events.
* ref: Restructures the RTP statistics event.
* ref: Restructures the CONNECTION_FAILED and DISCONNECTED events.
* ref: Restructures the getUserMedia analytics events.
* ref: Cleans up AnalyticsEvents and restructures some of the events.
* fix: Adds error logs to the analytics adapter.
* ref: Refactor Statistics.sendEventToAll
Renames to sendEventAndLog, supports the object-based API, uses the
function where appropriate.
* fix: Addresses PR feedback.
* fix: Addresses Lyubomir's feedback.
* ref: Remove unused functions, adds documentation.
* feat: Adds a Statistics.sendAnalytics shortcut.
* ref: Uses the conference name as the default containerId.
* fix: Adrdesses Lenny's feedback.
* fix: Addresses more feedback.
* fix: Uses 'operational' as the default event type.
* doc: Updates the documentation.
* fix: Fixes adding of permanent properties.
* ref: Uses consistent naming for events' attributes.
Uses "_" as a separator instead of camel case or ".".
* feat: Adds the conference name as a permanent property automatically.
* ref: Don't expose Setting.machineId.
* fix: Adds a "p2p" attribute to jingle events.
* ref: Uses "action" instead of "name".
* ref: Uses underscore in events' attribute names.
* ref: Logs a message to the logger/console
instead of callstats in sendAnalyticsAndLog().
* ref: Simplifies the logic for handling an incoming jingle session-initiate.
* fix: Don't redundantly log cross region
information under a field name called "label".
* cleanup: Simplifies code. Adds the userAgent as a permanent property
for statistics (so that the client doesn't have to).
* ref: Names the parameter which specifies the name of the event "eventName".
* ref: Extracts event names to AnalyticsEvents.
* ref: Exports and imports constants individually.
* fix: Fixes CONNECTION_TIMES event names.
* ref: Arranges constants alphabetically.
* ref: Adds line breaks.
This is a two part fix:
- In the new gum flow, this.getUserMedia supports promises
and rejections were not getting caught. So change
_newGetUserMediaWithConstraints to be promise based instead
of callback.
- The error name returned from blocked device permissions is
NotAllowedError, as adapter shims PermissionDeniedError
to be NotAllowedError.
fix(audio-output): update sinkIds on load and device list change (#642)
When a mac's default audio output is changed, audio elements
are not being updated with the new default. A default audio
output change in the OS fires a DEVICE_LIST_CHANGED event,
so use that to always update the sinkId.
Also, use wrapAttachMediaStream for newGumFlow to be ensure
the proper sinkId is set on audio elements being coupled
a remote track.