Skip to content

fix(ui): make video fit adaptive on web and desktop#1271

Open
Brazol wants to merge 2 commits into
mainfrom
fix/adaptive-fit-on-web
Open

fix(ui): make video fit adaptive on web and desktop#1271
Brazol wants to merge 2 commits into
mainfrom
fix/adaptive-fit-on-web

Conversation

@Brazol

@Brazol Brazol commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Video rendering now adapts more intelligently to the current stream orientation and aspect ratio, improving how video fills the screen.
    • Default video fit behavior now automatically matches the platform, with different defaults on mobile versus web/desktop.
  • Bug Fixes

    • Video display settings now fall back more consistently when no explicit fit mode is chosen.
    • Participant video appearance settings now support platform-based defaults for a more consistent viewing experience.

@Brazol Brazol requested a review from a team as a code owner July 7, 2026 10:08
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: faa7d40b-a224-4d06-89a3-2cf5f00a1e27

📥 Commits

Reviewing files that changed from the base of the PR and between a5eeb44 and c183bf2.

📒 Files selected for processing (3)
  • packages/stream_video_flutter/CHANGELOG.md
  • packages/stream_video_flutter/lib/src/renderer/video_renderer.dart
  • packages/stream_video_flutter/lib/src/theme/call_participant_theme.dart

📝 Walkthrough

Walkthrough

The videoFit property becomes nullable (VideoFit?) across StreamVideoRenderer, VideoTrackRenderer, and StreamCallParticipantThemeData. A new defaultVideoFit getter resolves to cover on mobile or adaptive otherwise. VideoTrackRenderer now recomputes object fit dynamically from RTCVideoValue via ValueListenableBuilder.

Changes

Nullable videoFit resolution

Layer / File(s) Summary
defaultVideoFit getter and adaptive docs
packages/stream_video_flutter/lib/src/renderer/video_renderer.dart
Adds top-level defaultVideoFit getter (cover on mobile, adaptive otherwise) and expands VideoFit.adaptive documentation.
StreamVideoRenderer nullable videoFit
packages/stream_video_flutter/lib/src/renderer/video_renderer.dart
Constructor and field for videoFit change from VideoFit to VideoFit?, resolving via defaultVideoFit when null.
VideoTrackRenderer nullable videoFit and dynamic fit logic
packages/stream_video_flutter/lib/src/renderer/video_renderer.dart
Constructor/field accept VideoFit?; build logic refactored to use ValueListenableBuilder over RTCVideoValue, with adaptive mode choosing cover vs contain based on aspect ratio, and _getVideoViewObjectFit updated to accept both fit and value.
StreamCallParticipantThemeData nullable videoFit
packages/stream_video_flutter/lib/src/theme/call_participant_theme.dart
videoFit field and constructor default removed in favor of nullable type, with documentation referencing defaultVideoFit.

Estimated code review effort: 2 (Simple) | ~15 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Widget as VideoTrackRenderer
  participant Renderer as _videoRenderer
  participant Builder as ValueListenableBuilder
  participant FitResolver as _getVideoViewObjectFit

  Widget->>Renderer: initialize
  Renderer-->>Widget: RTCVideoValue update
  Widget->>Builder: rebuild with value
  Builder->>FitResolver: resolve(videoFit, value)
  FitResolver-->>Builder: objectFit (cover/contain)
  Builder-->>Widget: render video view
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided, so the required goal, implementation, testing, and checklist sections are missing. Add the template sections for Goal, Implementation details, UI Changes, Testing, and the contributor/reviewer checklists.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adaptive video fit behavior on web and desktop.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/adaptive-fit-on-web

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.

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 10.16%. Comparing base (a5eeb44) to head (c183bf2).

Files with missing lines Patch % Lines
...video_flutter/lib/src/renderer/video_renderer.dart 0.00% 16 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1271   +/-   ##
=======================================
  Coverage   10.16%   10.16%           
=======================================
  Files         679      679           
  Lines       49765    49773    +8     
=======================================
+ Hits         5059     5060    +1     
- Misses      44706    44713    +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant