-
Notifications
You must be signed in to change notification settings - Fork 482
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
feat (player): optional rotate button in player and setting to enable auto rotate based on video orientation #813
Conversation
This is a really good addition, and the code looks nice. However it fucks up a bit with the current code located at cloudstream/app/src/main/java/com/lagradost/cloudstream3/ui/player/FullScreenPlayer.kt Line 289 in 3c152e0
So if you want this merged you can keep this behavior however you need to fix the updateOrientation function to not cause any bugs. By pressing lock you lock the current orientation completely otherwise you do sensor landscape/portrait. |
@fire-light42 can you share some desc on how updateorientarion and lockorientation is working? when are they triggered? |
where can I get the icons? |
Right now when the user enters the player they will be turned into sensor landscape and when pressing the lock button it will lock to the exact orientation that the player is currently in. updateOrientation is called when entering the player along with when you toggle the lock button. So in your case you need to add a bool like IsVerticalOrientation that is set when first loading a video by overriding playerDimensionsLoaded, then calling updateOrientation. updateOrientation should lock the player in the exact orientation the user is currenty in if isLocked otherwise it should use the sensor version of IsVerticalOrientation. Then the button just changes If you want icons then look at https://fonts.google.com/icons
|
thank you for explaining in detail. |
@fire-light42 changes are done. pls review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, however I have not tested this yet so you might get some more feedback soon
ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE | ||
|
||
Configuration.ORIENTATION_SQUARE, Configuration.ORIENTATION_UNDEFINED -> | ||
dynamicOrientation(activity) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will cause a bug as orientation will still be zero and 0 = SCREEN_ORIENTATION_LANDSCAPE, so this function will be called then it will call activity.requestedOrientation = SCREEN_ORIENTATION_LANDSCAPE
right under this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have the same problem in the other functons
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how it was in lockOrientation -> Configuration.ORIENTATION_SQUARE, Configuration.ORIENTATION_UNDEFINED, Configuration.ORIENTATION_PORTRAIT -> ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
Is this doing anything? there is no assignment.
Now in function i have added dynamicOrientation in that it will set-> activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
So what should be the change? should I keep it how it was? how to test this Configuration.ORIENTATION_SQUARE, Configuration.ORIENTATION_UNDEFINED?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I think dynamicOrientation should return what orientation it should be and then set orientation = dynamicOrientation(activity)
inside the when statments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohk I missed that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fire-light42 thanks. Pls chk now.
@fire-light42 i have fixed the issue you've shared. pls review and let me know if there is any other issue. |
What
في الاثنين، ١٨ ديسمبر ٢٠٢٣, ٨:٥٥ ص coxju ***@***.***> كتب:
… @fire-light42 <https://github.com/fire-light42> fixed the issue youve
shared. pls review and let me know there is any other issue.
—
Reply to this email directly, view it on GitHub
<#813 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A4ELJC4GYYU3LVMMOPCCVH3YJ7SHDAVCNFSM6AAAAABATKVG2SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJZGY2TINZUGU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
… auto rotate based on video orientation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, tested it now and it worked like a charm! 👍
setting page:
with rotate enabled: