feat: support 'maintain-framerate-and-resolution' degradation preference#43
Conversation
Adds the new W3C RTCDegradationPreference value to the TS type, and fixes toNative/fromNative to use global replaces so multi-dash tokens round-trip in both directions. The new value first lands in libwebrtc with Chrome M144, so the native binaries must include it before this is safe to merge. Hold until the pending M145 native SDK bump ships.
📝 WalkthroughWalkthrough
ChangesDegradation preference type and conversion
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/RTCRtpSendParameters.ts`:
- Around line 5-9: The union literal 'maintain-framerate-and-resolution' in the
DegradationPreferenceType should be gated or removed until the native enum
supports MAINTAIN_FRAMERATE_AND_RESOLUTION; update the type in
RTCRtpSendParameters.ts to exclude that literal (or add a runtime guard around
DegradationPreference.toNative so it never emits
MAINTAIN_FRAMERATE_AND_RESOLUTION on Android), and ensure any codepaths using
DegradationPreference.toNative or parsing via
RtpParameters.DegradationPreference.valueOf do not pass the unsupported value
until the native bump is shipped.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 06cbe990-f13c-42d6-8fb4-60bab9f818b7
📒 Files selected for processing (1)
src/RTCRtpSendParameters.ts
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
'maintain-framerate-and-resolution'toDegradationPreferenceTypetoNative/fromNativeto use global regex replaces (the existing single-replace was a latent bug for any multi-dash token)MAINTAIN_FRAMERATE_AND_RESOLUTIONfirst lands in libwebrtc with Chrome M144 (Intent to Ship).This SDK currently pins M137 on both platforms:
StreamWebRTC ~> 137.0.54io.getstream:stream-video-webrtc-android:137.0.1On M137, passing the new value will reject the JS promise on Android (
IllegalArgumentExceptionfromRtpParameters.DegradationPreference.valueOf) and silently no-op on iOS. Wait until the pending M145 native SDK bump is published before merging this PR.No native (iOS / Android) changes are needed: Android's
valueOfand iOS's plain NSString assignment will both work once the underlying binary ships the new enum value.