* ref(JSPC): simplify SSRC owner in P2P
There's no need for any extra extensions for SSRCs owner signalling in
P2P, because it's always the remote peer who owns them.
This also fixes a problem where no SSRC owner was added for 'source-add'
in P2P (for JVB conference Jicofo adds that).
* fix(TPC): always advertise 'sendrecv'
Our media direction is only ever updated on the remote side with
the initial offer (or answer). Because of that we want to advertise
'sendrecv' even if we start with no video (or audio) track.
It is OK to adjust this direction in the localDescription getter,
because it's adjusted again in the setter to the correct value based on
local tracks, so the SDP transformation chain still works fine.
feat(JingleSessionPC): add options for P2P evaluation
Add 'forceJVB121Ratio' config option which allows to enforce JVB
conference even if the P2P connection can be established. In such case
'forceJVB121' permanent analytics property will be added.
Will also set 'p2pFailed' analytics property to 'true' in case ICE fails
on the P2P connection.
Tries to batch as many reports as possible into single analytics event
and sends all of them under "avg.rtp.stats" event name.
Also converts dots to underscores in all of the stat names, because now
they become JSON keys where dots are not allowed.
fix(permission-prompt): increase timeout for displaying permission prompt
Firefox's getUserMedia can take longer than 500ms to complete. This
causes the permission prompt timeout to fire even if the user has
given permission to audio and video. There may not be a reliable
way right now to check if the user has given permission to both
audio and video so dumbly increase the timeout instead.
Reorders JitsiTrackEvents.TRACK_AUDIO_LEVEL_CHANGED event arguments by
putting TraceablePeerConnection at the end. This way it's easier to
treat it as "library internal".
Will actively terminate P2P session by the responder (not moderator) in
order to shutdown P2P in case of eventual initiator's crash. Otherwise
the responder will stay in P2P for too long (until P2P ICE fails).
Prevents from printing Jingle 'session-terminate' error response in case
both responder and initiator terminates their sessions simultaneously
(gracefully). In that case 'item-not-found' error is returned by each
party, because the session is removed immediately from the memory on
termination (see strophe.jingle.js).
fix(JitsiConference): case for stopping JVB transfer
If for any reason invite for the JVB JingleSession is delayed and
arrives after the P2P connection has been established then
the media transfer needs to be disabled after the offer is accepted.
If the app depends on tracking current tracks state using
"track added/removed" events, the tracks will be leaking if
JitsiConference.leave() method is used. That's because peerconnections
are closed and removed from RTC module and then from onMemberLeft those
events will not be fired, because tracks will be gone with
the peerconnections.
Also removes error message log, because it no longer makes sense if
the tracks can be removed early by "stop P2P" logic without actually
removing them from the TPC. Then when the TPC is closed it will try to
emit the events again. But this time it will not match any tracks in
the JitsiParticipant, because it has been removed already.
fix(JingleSessionPC): execute 'invite' on the queue
Invite must be executed on the queue to avoid strange things happening
on the beginning of the call. For example when the local tracks are
added just after the invite was called.
Move the JingleSessionPC to ACTIVE state, as soon as the first
_renegotiate is executed in PENDING state.
Avoid a crash if for whatever reason there is no JVB JingleSessionPC at
the time when P2P is being stopped.
Add FIXME about possible situation where Jicofo invite will arrive after
the P2P has been established already.
Dominant speaker detection which is just based on current audio level of local or remote p2p track. The threshold value is the same used for talk while muted detection.
Firefox uses "constraint" as the key in the error:
```
[modules/RTC/RTCUtils.js] <value/<>: Failed to get access to local media. Error
MediaStreamError { name: "OverconstrainedError", message: "Constraints could be
not satisfied.", constraint: "width", stack: "" } Object { audio: false, video:
Object } lib-jitsi-meet.min.js:6:10419
```