Skip to content

Conversation

@santhoshvai
Copy link
Member

@santhoshvai santhoshvai commented Nov 6, 2025

💡 Overview

Follow up to #1969

The current algorithm only handles portrait local video on floating view. Which is default on mobile.
But we can change it to landscape video from web for example.

Landscape video needs more width. And this PR fixes it. Again, based on Android AOSP algorithm here.

Additionally, we use screen dimensions to compute the base dimensions now. Because, say if integrator wants to constrain the CallContent to small view, the floating dimensions can become extremely small. Using screen dimensions make it independent of that. This is consistent with Android PiP mode also.

Portrait video Landscape video
Screenshot_20251106-114806 Screenshot_20251106-114758

Ticket: https://linear.app/stream/issue/RN-302

@santhoshvai santhoshvai changed the title fix: missinf adaptive floating dimensions for landscape video fix: missing adaptive floating dimensions for landscape video Nov 6, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the floating video dimensions calculation to handle both portrait and landscape videos more accurately. The algorithm now bases its size on the shorter container dimension rather than only the container width, and applies different sizing logic depending on the video's aspect ratio.

  • Changed base dimension calculation from 23% of container width to 23% of the shorter container dimension
  • Added container height validation to the early return condition
  • Introduced portrait vs landscape video detection and differentiated sizing logic for each orientation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

4 participants