degradationPreference

open override val degradationPreference: RtpParameters.DegradationPreference? = null

Controls how the encoder trades off between resolution and framerate when bandwidth is constrained.

  • MAINTAIN_FRAMERATE: Prioritizes framerate, reduces resolution if needed

  • MAINTAIN_RESOLUTION: Prioritizes resolution, drops frames if needed

  • BALANCED: Balances between both

If not set (null), the SDK uses defaults based on track source:

  • Camera: MAINTAIN_FRAMERATE (smoother video for real-time communication)

  • Screen share: MAINTAIN_RESOLUTION (clarity is critical for text/UI)

  • Other/unknown: BALANCED

Note that a preference is always applied to video senders, so leaving this null selects the source-based default above rather than deferring to WebRTC's own implicit choice.