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

Allow app to update StyledPlayerView fullscreen state 'out of band' #10391

Closed
samfundev opened this issue Jun 29, 2022 · 5 comments
Closed

Allow app to update StyledPlayerView fullscreen state 'out of band' #10391

samfundev opened this issue Jun 29, 2022 · 5 comments
Assignees

Comments

@samfundev
Copy link

Use case description

When using StyledPlayerControlView's fullscreen button, it should be able to follow the orientation of the device. If the user rotates into landscape, the button should exit fullscreen. Not try to enter fullscreen again.

Proposed solution

StyledPlayerControlView should watch for orientation changes and trigger fullscreen updates if the device enters landscape.

Alternatives considered

Not using StyledPlayerControlView's fullscreen button. Fullscreen cannot be manually set, so there is no way to tell it that the orientation has changed.

@icbaker
Copy link
Collaborator

icbaker commented Aug 19, 2022

I could be misunderstanding, but there seems to be an implicit assumption here that when an app rotates into landscape the video will always be made fullscreen. I don't think that's a reasonable assumption in the general case.

I understand that some apps will have this behaviour. More generally, it seems reasonable that an app will want to enter fullscreen mode without the user hitting the UI fullscreen button (whether that's due to rotation, or another signal), and in that case needs a way to indicate to the UI to update the 'mode' of the button. I think this is also what you're pointing out is missing here (emphasis mine):

Fullscreen cannot be manually set, so there is no way to tell it that the orientation has changed.

So if we changed this enhancement into allowing apps to indicate the fullscreen state has changed (without the UI fullscreen button being pressed), would that resolve your concern?

@samfundev
Copy link
Author

there seems to be an implicit assumption here that when an app rotates into landscape the video will always be made fullscreen. I don't think that's a reasonable assumption in the general case.

I agree that the video will not always be fullscreen, but that I'm assuming this is a common use case. So this would be a feature developers would opt into.

So if we changed this enhancement into allowing apps to indicate the fullscreen state has changed (without the UI fullscreen button being pressed), would that resolve your concern?

Yes, that would.

@icbaker icbaker changed the title Fullscreen button should be able to follow orientation Allow app to update StyledPlayerView fullscreen state 'out of band' Sep 8, 2022
@icbaker
Copy link
Collaborator

icbaker commented Sep 8, 2022

Thanks for confirming my proposal would work. I'm afraid I don't know when we'll implement this, but we would accept a high quality PR for this.

@raytiley
Copy link

raytiley commented Dec 5, 2022

Stumbled upon this issue, but also using expolayer in a jetpack compose app, and it seems that due the nature of compose and how views are torn down and recomposed if state changes, the act of triggering a non-fullscreen to fullscreen with the fullscreen button in PlayerView causes the internal state of the button to be lost.

At least that's what we are seeing in our app, and it has nothing todo with orientation change.

We just simply hit the button, which causes the rendering to change, and then the player no longer displays as full screen.

Are there any examples of a working fullscreen button in jetpack compose with expo player? Maybe our approach at making the player full screen is just wrong?

Thanks.

@icbaker
Copy link
Collaborator

icbaker commented Aug 2, 2024

Duplicate of androidx/media#1590 (duping against the newer issue since it's in the currently-maintained media3 project).

@icbaker icbaker closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2024
@google google locked and limited conversation to collaborators Oct 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants