Skip to content

Fix aspect ratio when pixelWidthHeightRatio not equal 1#1244

Merged
StaehliJ merged 3 commits intomainfrom
fix-aspect-ratio-using-pixelratio
Feb 11, 2026
Merged

Fix aspect ratio when pixelWidthHeightRatio not equal 1#1244
StaehliJ merged 3 commits intomainfrom
fix-aspect-ratio-using-pixelratio

Conversation

@StaehliJ
Copy link
Contributor

@StaehliJ StaehliJ commented Feb 9, 2026

Description

Fix an issue when content playing needs VideoSize.pixelWidthHeightRatio to make the video vertical instead of horizontal. This PR remove the computing of the aspect ratio from video tracks because Fomat.pixelWidthHeighRatio always return 1 instead of the correct value.

The issue affect only the depreciated PlayerSurface and anyone using Player.getAspectRatioAsFlow and Player.getAspectRatioAsState.

Changes made

  • AspectRatio is only computed from VideoSize.
  • May introduce "again" some strange effect with a playlist with different aspect ratio.

Checklist

  • APIs have been properly documented (if relevant).
  • The documentation has been updated (if relevant).
  • New unit tests have been written (if relevant).
  • The demo has been updated (if relevant).

…s always set to 1.

For vertical video using this.pixelWidthHeightRatio to flip the video it won't work.
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Pillarbox Feb 9, 2026
@StaehliJ StaehliJ changed the title Don't compute aspectRatio from Format as this.pixelWidthHeightRatio i… Fix aspect ratio when pixelWidthHeightRatio not equal 1 Feb 9, 2026
@github-actions
Copy link

github-actions bot commented Feb 10, 2026

Code Coverage

Overall Project 44.55% -0.09% 🟢
Files changed 56.98% 🟢

Module Coverage
:pillarbox-player 57.18% -0.22% 🟢
Files
Module File Coverage
:pillarbox-player VideoSize.kt 85.25% -14.75% 🟢
PlayerCallbackFlow.kt 60.28% -1.65% 🟢

@StaehliJ StaehliJ enabled auto-merge February 11, 2026 10:42
@StaehliJ StaehliJ added this pull request to the merge queue Feb 11, 2026
Merged via the queue into main with commit 5b093aa Feb 11, 2026
12 checks passed
@StaehliJ StaehliJ deleted the fix-aspect-ratio-using-pixelratio branch February 11, 2026 10:50
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Pillarbox Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants