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 inconsistencies on Android #424

Merged
merged 8 commits into from
Apr 5, 2024

Conversation

zigavehovec
Copy link
Contributor

@zigavehovec zigavehovec commented Apr 4, 2024

Description

The PiP implementation on Android was very complex and made some wrong assumptions, which caused a few bugs. Most notably:

Changes

Checklist

  • 🗒 CHANGELOG entry

@zigavehovec zigavehovec self-assigned this Apr 4, 2024
@zigavehovec zigavehovec marked this pull request as ready for review April 4, 2024 07:26
@zigavehovec zigavehovec requested a review from a team as a code owner April 4, 2024 07:26
@zigavehovec zigavehovec requested review from strangesource and rolandkakonyi and removed request for a team April 4, 2024 07:27
Copy link
Contributor

@strangesource strangesource left a comment

Choose a reason for hiding this comment

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

Very nice simplifications/improvements! Just some NIT from my side.

CHANGELOG.md Outdated

### Fixed

- Android: Entering Picture-in-Picture automatically from all screens when navigating the app to the background (after navigating to Basic Picture-in-Picture screen once)
Copy link
Contributor

Choose a reason for hiding this comment

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

This entry is very specific for our samples, is this something that only happens in our samples? If so we should make this clear. Otherwise, can we make it a bit more generic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's kind of both, I would suppose that it should happen to other single activity apps. I'll write it in a more generic way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

// Explicitly call `exitPictureInPicture()` on PlayerView when exiting PiP state, otherwise
// the `PictureInPictureExit` event won't get dispatched.
playerView?.exitPictureInPicture()
private fun isInPictureInPictureMode(): Boolean {
Copy link
Contributor

Choose a reason for hiding this comment

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

This function has a very similar name to the property isPictureInPictureMode which makes it quite confusing. Should we rename to e.g. isCurrentActivityInPictureInPictureMode or convert it to an extension function on the activity?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

zigavehovec and others added 3 commits April 4, 2024 16:40
Co-authored-by: Lukas Knoch-Girstmair <strangesource@users.noreply.github.com>
Copy link
Contributor

@rolandkakonyi rolandkakonyi left a comment

Choose a reason for hiding this comment

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

iOS still works :)

I can't judge the Android part.

Could you also update the guide here?
https://developer.bitmovin.com/playback/docs/enabling-picture-in-picture-mode

For the record: I also tested Android and it works!

@rolandkakonyi rolandkakonyi self-requested a review April 5, 2024 11:22
Copy link
Contributor

@rolandkakonyi rolandkakonyi left a comment

Choose a reason for hiding this comment

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

Approving but please still update the guide!

@zigavehovec
Copy link
Contributor Author

Approving but please still update the guide!

Added a section in the guide here: https://developer.bitmovin.com/playback/docs/enabling-picture-in-picture-mode#adjust-the-ui-for-picture-in-picture-mode-on-android

@zigavehovec zigavehovec merged commit 6e7b42f into development Apr 5, 2024
6 checks passed
@zigavehovec zigavehovec deleted the PRN-103/PiP-inconsistencies branch April 5, 2024 12:16
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.

3 participants