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

Upside down rotation still causes rotation to reset to portrait #1332

Closed
1 of 3 tasks
AnnieTheEagle opened this issue Sep 11, 2024 · 14 comments
Closed
1 of 3 tasks

Upside down rotation still causes rotation to reset to portrait #1332

AnnieTheEagle opened this issue Sep 11, 2024 · 14 comments
Labels
Bug Something isn't working Core Rotation UI/UX

Comments

@AnnieTheEagle
Copy link

What happened?

When I rotate my device upside down (something that often happens when I'm lying in bed on my side, watching videos in landscape), the app still rotates back to 0° portrait even with the new "Allow reverse portrait" option disabled.

This is unlike any other video player I've used where rotating from 90 (landscape) to 180, causes the app to stay in landscape. Even most system apps and non multimedia apps do this.

Expected behaviour:
When "Allow reverse portrait" is disabled: The app should stay in the most recent landscape rotation, rather than resetting back to 0°
When "Allow reverse portrait" is enabled: The app should rotate to 180° (portrait but upside down).

Grayjay Version

264

What plugins are you seeing the problem on?

All

Plugin Version

No response

When do you experience the issue?

  • While logged in
  • While logged out
  • N/A

Relevant log output

No response

@github-actions github-actions bot added the All label Sep 11, 2024
@Allvaldrsson
Copy link

There's a setting called "Full auto rotate lock" that restores the feature to its previous function. I'm not sure what they were attempting to solve.

@usertoroot
Copy link
Contributor

There are a few overlapping use-cases here:

  1. There are people who disable auto rotation (either by using rotation lock on the player, disabling rotation on system or disabling rotation entirely) but still want to be able to have the landscape view rotate (but always stay in landscape). For these people we encourage to use the rotation lock or disable automatic rotation entirely in the settings.
  2. There are people who like auto rotate to enter/exit fullscreen mode. This is the default behaviour.
  3. There are people who want the rotation lock to disable ALL rotations, even rotating between the 2 landscapes when in fullscreen. For these people the setting "Full auto rotate lock" exists.

@AnnieTheEagle
Copy link
Author

There's a setting called "Full auto rotate lock" that restores the feature to its previous function. I'm not sure what they were attempting to solve.

Doesn't change the behaviour for what I'm seeing either.

Allowing upside down portrait or not, in what conceivable scenario should the device being held in a 180° rotation result in a 0° rotation actually being displayed and everything being upside down.

I'm surprised this hasn't been fixed. I remember seeing this bug months ago and it's one of the last blockers from getting me to switch over from ReVanced or NewPipe.

@usertoroot
Copy link
Contributor

Does one of these cases solve it for you? What is your final goal?

The way I am reading your post you want when you manually enter fullscreen, to not automatically rotate out of fullscreen when you rotate your phone to one of the portrait views.

In this case you can either use rotation lock, disable auto rotation in settings or disable rotation on the system.

@AnnieTheEagle
Copy link
Author

There are a few overlapping use-cases here:

1. There are people who disable auto rotation (either by using rotation lock on the player, disabling rotation on system or disabling rotation entirely) but still want to be able to have the landscape view rotate (but always stay in landscape). For these people we encourage to use the rotation lock or disable automatic rotation entirely in the settings.

2. There are people who like auto rotate to enter/exit fullscreen mode. This is the default behaviour.

3. There are people who want the rotation lock to disable ALL rotations, even rotating between the 2 landscapes when in fullscreen. For these people the setting "Full auto rotate lock" exists.

No I understand that. I am in the camp of option 2, where I use auto-rotate to enter/exit fullscreen. However, I dont ever hold my device upside down to exit a landscape orientation. None of my other apps do this (multimedia or not).

To prove this, simply open up Firefox (or any fork thereof, e.g. IceRaven) and rotate your device landscape, now hold it upside down portrait, it will stay in the previous landscape orientation (whether you went from 0 -> 270 -> 180 (stays at 270), or 0 -> 90 -> 180 (stays at 90).

My end goal is to be able to use Grayjay in bed (I allow myself 1-2 educational videos before sleeping [usually Chess -- right now]). A lot of people will lie in bed on their side. If you want to watch in landscape, while laying on your side, your physical device must be upside down (90 degrees rotation on your physical person, 90 degrees rotation on the phone). But I want the videos to remain landscape (i.e. fullscreen), just like any other app I have does, without needing to manually toggle rotation lock every time.

@AnnieTheEagle
Copy link
Author

AnnieTheEagle commented Sep 11, 2024

The way I am reading your post you want when you manually enter fullscreen, to not automatically rotate out of fullscreen when you rotate your phone to one of the portrait views.

Incorrect. I want it to:

  1. Automatically enter fullscreen when going from 0 -> 270 or 0 -> 90.
  2. Automatically exit fullscreen when going from 270 -> 0 or 90 -> 0.
  3. Not change orientation at all when going from 270 -> 180 or 90 -> 180.

This is how almost every other app I have installed works. I can think of only one app that didn't do these three things by default, and (3) was resolved with a simple "Disallow upside-down rotation" in the settings (after which it did exactly as described in the 3 points above).

As it stands right now:
The Allow reverse portrait allows it to handle 270 -> 180 and 90 -> 180 correctly, by actually rotating the content upside down so it's still right-side-up for the user.
Disabling it goes back to the weird behavior of 270 -> 180 and 90 -> 180 actually being handled as being rotated to 0.

@AnnieTheEagle
Copy link
Author

@usertoroot If it helps, I'm willing to actually record a video (not screen recording) of what I mean. With an example app showing the correct behavior too (I'll just use Firefox, as I mentioned it before).

Would this help you visualise my issue?

@usertoroot
Copy link
Contributor

OK I believe I understand what you are suggesting

  1. Automatically enter fullscreen when going from portrait/reverse portrait to landscape/reverse landscape
  2. Automatically exit fullscreen when going from landscape/reverse landscape to portrait
  3. Not change orientation at all when going from landscape/reverse landscape to reverse portrait
    Is that correct?

@AnnieTheEagle
Copy link
Author

OK I believe I understand what you are suggesting

1. Automatically enter fullscreen when going from portrait/reverse portrait to landscape/reverse landscape

2. Automatically exit fullscreen when going from landscape/reverse landscape to portrait

3. Not change orientation at all when going from landscape/reverse landscape to reverse portrait
   Is that correct?

I suppose so yes, but one could also just exclude reverse portrait -> landscape/reverse landscape from (1) and just not handle reverse portrait at all (which is what I assumed Allow reverse portrait being disabled would do).

@AnnieTheEagle
Copy link
Author

AnnieTheEagle commented Sep 11, 2024

In summary, as a state machine, and below Any refers to any previous state.

Allow reverse portrait ON:

  • Any -> 90 - Rotates to landscape.
  • Any -> 180 - Rotates to reverse portrait.
  • Any -> 270 - Rotates to reverse landscape.
  • Any -> 0 - Rotates to portrait.

Allow reverse portrait OFF:

  • Any -> 90 - Rotates to landscape.
  • Any -> 180 - Nothing happens, it stays in the previous rotation it was in before (This is Firefox's behaviour)
  • Any -> 270 - Rotates to reverse landscape.
  • Any -> 0 - Rotates to portrait.

Example state machine traversal for Allow reverse portrait OFF, all the degrees shown are +/- deadzone/hysteresis setting:

Initial State: Portrait.
Transition 1: Device is rotated to 90 degrees. Viewport is rotated to Landscape orientation.
Transition 2: Device is rotated to 180 degrees. No transition, viewport remains Landscape orientation.
Transition 3: Device is rotated to 90 degrees again. Viewport is "rotated" to Landscape orientation (no actual change since Landscape == Landscape).
Transition 4: Device is rotated to 0 degrees again. Viewport is rotated to Portrait orientation.

Now, if Transition 3 was "Device is rotated to 270 degrees", then the viewport would be rotated to "Reverse Landscape" because Reverse Landscape != Landscape.

Sorry if I'm going too in-depth, as a developer myself I know developer time is very valuable and nothing is more frustrating than an end-user that isn't clear with what they are asking. :)

@usertoroot
Copy link
Contributor

Thanks for the explanation I think that makes sense. Will look at it for the next build. For a temporary workaround I hope disabling auto rotation will suffice for now.

@AnnieTheEagle
Copy link
Author

Thanks for the explanation I think that makes sense. Will look at it for the next build. For a temporary workaround I hope disabling auto rotation will suffice for now.

Thanks, would you be able to reply on this thread once it's resolved? I do hope it can be resolved as having to manually toggle auto-rotation is really annoying and I often end up just switching back to ReVanced, which isn't ideal of course given it's dependence on microG.

@SupremeLobster
Copy link

SupremeLobster commented Sep 12, 2024

The issue seems to be a conflict between autorotate settings and the "allow fullscreen portrait" setting being enabled. Fullscreen portrait should ONLY be allowed on videos that have a portrait aspect ration, and ONLY if the setting is enabled. It makes not sense to enter fullscreen portrait mode on a video that is not portrait. Seems like an easy fix: just check the aspect ratio of the video. This is exactly the behavior of the official YouTube app, and it works pretty well. It also makes a lot of sense.

EDIT: Also, videos with portrait aspect ratio should not rotate at all even if you have autorotate turned on.

@support-grayjay support-grayjay added Bug Something isn't working UI/UX Core Rotation and removed All labels Nov 3, 2024
@Zvonimir-FUTO
Copy link
Collaborator

This has been fixed in the upcoming release (v265).

@mingyee2 mingyee2 mentioned this issue Nov 30, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Core Rotation UI/UX
Projects
None yet
Development

No branches or pull requests

6 participants