Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PIP mode orientation #160

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

tukez
Copy link
Contributor

@tukez tukez commented Aug 20, 2024

When app is in PIP mode, it is possible that the device is in different orientation than the app. In this case the stream is of wrong aspect ratio and rotation. I fixed this problem in my app by changing the Context.isDevicePortrait to actually give device orientation instead of application orientation (since orientation provider otherwise uses the device orientation).

On the implementation:
Display.getRotation() gives the rotation from the "natural" orientation of the device so my code tries to figure out the natural orientation of the device from its physical size. I don't have a device with natural orientation of landscape so I can't be sure it works on those devices.

ThibaultBee and others added 4 commits August 8, 2024 15:38
Bumps androidx.appcompat:appcompat from 1.6.1 to 1.7.0.

---
updated-dependencies:
- dependency-name: androidx.appcompat:appcompat
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps androidx.test.espresso:espresso-core from 3.5.1 to 3.6.1.

---
updated-dependencies:
- dependency-name: androidx.test.espresso:espresso-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@ThibaultBee
Copy link
Owner

Hi,
Thanks for the PR.
Sorry I don't have much time lately. Could you provide a sample to test the PiP?

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