Skip to content

feat: support 'maintain-framerate-and-resolution' degradation preference#43

Merged
santhoshvai merged 1 commit into
ios-render-improvfrom
feat/degradation-preference-maintain-framerate-and-resolution
May 27, 2026
Merged

feat: support 'maintain-framerate-and-resolution' degradation preference#43
santhoshvai merged 1 commit into
ios-render-improvfrom
feat/degradation-preference-maintain-framerate-and-resolution

Conversation

@oliverlaz

@oliverlaz oliverlaz commented May 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Add 'maintain-framerate-and-resolution' to DegradationPreferenceType
  • Fix toNative / fromNative to use global regex replaces (the existing single-replace was a latent bug for any multi-dash token)

⚠️ DO NOT MERGE before the M145 native SDK bump

MAINTAIN_FRAMERATE_AND_RESOLUTION first lands in libwebrtc with Chrome M144 (Intent to Ship).
This SDK currently pins M137 on both platforms:

  • iOS: StreamWebRTC ~> 137.0.54
  • Android: io.getstream:stream-video-webrtc-android:137.0.1

On M137, passing the new value will reject the JS promise on Android (IllegalArgumentException from RtpParameters.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 valueOf and iOS's plain NSString assignment will both work once the underlying binary ships the new enum value.

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.
@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

RTCRtpSendParameters now supports the maintain-framerate-and-resolution degradation preference. The type definition is expanded, and the native↔web format conversion functions are updated to apply underscore/dash replacement globally for all preference values.

Changes

Degradation preference type and conversion

Layer / File(s) Summary
Degradation preference type and format conversion
src/RTCRtpSendParameters.ts
DegradationPreferenceType is expanded to include 'maintain-framerate-and-resolution' literal. The fromNative and toNative functions are updated to convert all underscores to dashes (and vice versa) globally instead of handling specific values individually.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A preference for frames so true,
Dashes dance where underscores once flew,
Maintain clarity, maintain the way,
Your video streams shall thrive each day! 🎬

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the primary feature addition in the changeset: support for the 'maintain-framerate-and-resolution' degradation preference value.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/degradation-preference-maintain-framerate-and-resolution

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3209a9b and ba7e0f4.

📒 Files selected for processing (1)
  • src/RTCRtpSendParameters.ts

Comment thread src/RTCRtpSendParameters.ts
@santhoshvai santhoshvai changed the base branch from master to ios-render-improv May 27, 2026 13:30
@santhoshvai

Copy link
Copy Markdown
Member

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@santhoshvai santhoshvai merged commit fb5269a into ios-render-improv May 27, 2026
4 checks passed
@santhoshvai santhoshvai deleted the feat/degradation-preference-maintain-framerate-and-resolution branch May 27, 2026 13:42
@coderabbitai coderabbitai Bot mentioned this pull request Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants