-
-
Notifications
You must be signed in to change notification settings - Fork 521
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
Re-add "Ends at" time to playback control overlay #616
Conversation
Just realized I didn't do a proper string resource but before I worry about fixing let me know if you all approve of this method and then if the colon should be in the ends at string |
Test notes:
For the second you can use the DateFormat class which should follow system preferences. |
…text of TextView to "Loading..."
I can't check these off but I'm pretty sure I addressed all of them. I also added some null checks but I don't know if they are really needed. The delay on the text showing up is due to when |
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.
I just made it show 'Loading...' by default.
I noticed the video duration shows up earlier so it should be possible to show the "ends at" text earlier too. Just need to find the right place to add it.
...main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomPlaybackTransportControlGlue.java
Outdated
Show resolved
Hide resolved
I addressed both the issues. Should we save the context to a variable and replace all calls to |
I over complicated the solution. I'm going to move the textview creation back inside the onCreateViewHolder function and use the setEndsText function in there to remove the need for the null pointer check. But still, are we okay with storing the context received on class creation in a variable and reusing or are the calls to get context not taxing enough to worry about that? |
…ybackTransportControlGlue.java
The parent class stores the context and |
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.
When you pause a video for multiple minutes the "ends at" won't update. It will update when playback starts again but this is slightly confusing. We might want to start a handler or similar to update the contents every minute/few seconds while a video is paused - make sure to destroy it when playback starts again or the view is destroyed.
...main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomPlaybackTransportControlGlue.java
Outdated
Show resolved
Hide resolved
...main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomPlaybackTransportControlGlue.java
Outdated
Show resolved
Hide resolved
...main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomPlaybackTransportControlGlue.java
Outdated
Show resolved
Hide resolved
...main/java/org/jellyfin/androidtv/ui/playback/overlay/CustomPlaybackTransportControlGlue.java
Outdated
Show resolved
Hide resolved
I also found an issue where the TextView would not hide when scrolling on the seek bar. I fixed this in the handler but in order to have it be snappy I had to make the handler repeat faster. The handler also has to run 24/7 now when playing as it polls the other view for its visibility state. Let me know what you think about that and if you may have a better method that may not be so taxing, if this method even is taxing on the system. It may need to repeat even faster to make it look like a natural part of the UI |
You might not need to keep the handler loop active when you use addOnLayoutChangeListener. I'm not sure if that listener is always called though. |
I'll try that out. I did also find another spot where I can catch the views being set invisible instantly so from there I could start a handler to check if they are visible again and then kill it so it won't need to run 24/7. |
Forgot to change the commit message on the first one. 🙈 Whoops lol. Anyways, I ended up doing the second approach. It seems to work nicely. The ends at time also updates while paused. I believe that addresses all issues. |
Apparently I was running an old build lol |
For the current leanback player this works fine but we should definitely use another approach when rewriting the playback UI. |
I agree. I honestly don't think it would be too hard to make our own playback controls and still use it with the Glue/Host template. |
Changes
Add the "Ends At: ####" back to the control overlay
Issues