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

CallState

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

Link copied to clipboard
Link copied to clipboard

subscriber peer connection is used for subs

Link copied to clipboard
val trackDimensions: MutableStateFlow<Map<String, Map<<Error class: unknown class>, TrackDimensions>>>
Link copied to clipboard
val trackDimensionsDebounced: Flow<Map<String, Map<<Error class: unknown class>, TrackDimensions>>>
Link copied to clipboard
var tracks: MutableMap<String, MutableMap<<Error class: unknown class>, MediaTrack>>

Functions

Link copied to clipboard
fun cleanup()
Link copied to clipboard
suspend fun connect(reconnectDetails: <Error class: unknown class>? = null)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Triggered whenever we receive new ice candidate from the SFU

Link copied to clipboard

This is called when the SFU sends us an offer

Link copied to clipboard

https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/negotiationneeded_event

Link copied to clipboard
suspend fun reconnect(forceRestart: Boolean)
Link copied to clipboard
suspend fun requestPublisherIceRestart(): Result<<Error class: unknown class>>
Link copied to clipboard
suspend fun requestSubscriberIceRestart(): Result<<Error class: unknown class>>
Link copied to clipboard
Link copied to clipboard
fun updateTrackDimensions(sessionId: String, trackType: <Error class: unknown class>, visible: Boolean, dimensions: <Error class: unknown class> = defaultVideoDimension)