RtcSession
The RtcSession sets up 2 peer connection
The publisher peer connection
The subscriber peer connection
It handles everything webrtc related. State is handled by the call state class
See also
Audio/video management is done by the MediaManager
This is how the offer/answer cycle works
sessionId is created locally as a random UUID
create the peer connections
capture audio and video (if we're not doing so already, in many apps it should already be on for the preview screen)
execute the join request
add the audio/video tracks which triggers onNegotiationNeeded
onNegotiationNeeded(which calls SetPublisherRequest)
JoinCallResponseEvent returns info on the call's state
Dynascale automatically negotiates resolutions across clients
We send what resolutions we want using UpdateSubscriptionsRequest.
It should be triggered as we paginate through participants
Or when the UI layout changes
The SFU tells us what resolution to publish using the ChangePublishQualityEvent event
Properties
subscriber peer connection is used for subs
Functions
Triggered whenever we receive new ice candidate from the SFU
This is called when the SFU sends us an offer
https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/negotiationneeded_event