-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Player seekbar thumbnail preview #6434
Conversation
since it shows thumbnail previews, would it be possible to implement this #6383 ? |
Thank you so much, @litetex! This looks awesome! And it is also one of those big features that people miss when they shift to Newpipe. Feedback: Why are the menu options called High and Low Quality when it is actually the Preview Size that is changing? They should be called Large and Small Preview or something instead. Both with High and Low Quality, the preview images are pixelated. At least on a 1080p screen. So as a result it looks like the Large and Small Previews actually have the same quality in proportion, but for different sizes. |
Thank you for the feedback 😄 I called them high and low quality, because yt returns 2 storyboard/seekbar thumnail sizes - high and low quality.
I may be revising this to make it work better with different devices (tablets, TVs, smartphones). Currently this way it looks (at least) with "high quality" somewhat similar to the current YT behavior (on the website + app). I think renaming these would be a good idea, I will do that when I have time again 😄 |
Ohkay. I don't know what it looks like on Youtube, but if that's the highest possible quality, then maybe try making the preview a little smaller? The smaller preview is already quite small, though. Hmmm. Maybe leave the smaller one as it is. Well, we'll need to try a few things, probably. |
Well, I wanted to test with the latest changes, but the CI job failed. |
Occurs because underlying extractor pr is missing / not merged: I built a new apk: Note: The manual build guide as stated in the PR description above also works :) |
@litetex Are you not supposed to update the Extractor version to the one that corresponds to your Extractor PR's latest commit? I may be wrong, but I think that's the general procedure. |
I can do that but, this will point to my repo not NewPipe's so guess the person who merges that has to fix it 😆 |
f1b462b
to
f1a9c87
Compare
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 did not review carefully, but from a first look the code is a beauty! Thank you :-D
app/src/main/java/org/schabi/newpipe/player/helper/SeekbarPreviewThumbnailHelper.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/player/helper/SyncImageLoadingListener.java
Outdated
Show resolved
Hide resolved
4b1333c
to
84337f2
Compare
@Stypox I rebased the complete branch and applied the requested changes. |
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.
Code looks good to me, but I would also like someone else to review. Thank you @litetex for the hard work! I tested and everything seems to work well on API 29 (real phone), API 29 (emulated TV), API 30 (emulated tablet). I was unable to test on API 19 since in the emulator the codecs to open videos are missing.
app/src/main/java/org/schabi/newpipe/player/seekbarpreview/SeekbarPreviewThumbnailHolder.java
Show resolved
Hide resolved
I just noticed that this replaces the seek time in the centre of the player with one below the preview thumbnail. I think we should try keeping the seek time in the centre like before. Below the thumbnail, it might be too tiny for some people to read. |
That's standard procedure, don't worry. |
People don't really need to care about the current time and end time. But when seeking, they may want to focus on the seek time. How about putting it above the thumbnail instead of below, and making it bigger? |
I think the seek time should be in the lower left corner instead of the center. |
I think we should not reinvent the wheel and just keep the standard behaviour. Making the text a little bit bigger is a good compromise, but I would not make anything different. |
84337f2
to
9ddf16c
Compare
@opusforlife2 @litetex Placing the seek time below the thumbnail looks more natural in my opinion, maybe just because that's the usual way. On the other hand placing the seek time above has multiple advantages: making the text more readable and having the thumbnail overlay cover a smaller portion of the player below. So I'd go with seek time above, at the end of the day.
I'd rather not do this as it would cover more of the player below. It looks just fine as it already is imo. |
31fac79
to
809ca4c
Compare
Guess the majority wins. Update: |
The behavior in the latest apk looks polished and works well in my opinion |
Yay! Looks awesome! Thanks, @litetex! |
@litetex please rebase one last time, then I will do one last round of review and merge this :-) |
Moved seekbar preview up a bit, so the finger is not obstructing the view
171426c
to
efd038a
Compare
@Stypox |
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.
Code looks good to me, thank you for the dedication! I tested on my API 29 phone and on emulated API 19, API 21, API 29 (tv), API 30, API 30 (tablet). I tried both fullscreen and not-fullscreen. (on API 19 and 21, though, I could not find any playable video with a frameset: newer videos do not play because of missing decoders and "me at the zoo" has no frameset)
If I have time, I will test the current develop on my old Android 4.4 device. Last time I tested it (about 2 weeks ago) everything was looking fine. |
What is it?
Description of the changes in your PR
Click here to show the demo (screenshots + video) data
(it's a lot so it's collapsed by default)
demo.compressed.mp4
Implementation details (click to open)
These are the major parts of this implementation:
(Meta)-Data
The metadata of a video contains a new field (the extractor had to be modified for this → TeamNewPipe/NewPipeExtractor#647 )
How it get's into the seekbar
The metadata is changed in the player, when a new video is played/started.
When this happens the urls get asynchronously fetched and processed, which happens mostly in
SeekbarPreviewThumbnailHolder
Note: The images from the url are not "pre-processed". The extraction of the corresponding preview thumbnail and resizing happens when the seekbar is changed.
When the seekbar is moved the closest image to the current position (in ms) is searched and returned.
If none is found or an error occurs the thumbnail will simply be hidden.
After thumbnail was extracted from/cut out of the "base" image (from the url of the frameset) it will also be resized:
The size of the final thumbnail is calculated as follows:
Settings
New option"seekbar thumbnail preview" (under Settings>Video and audio>Player)
Can contain the following values:
The settings will be applied when the next video is started / opened or more specific when the metadata of the player is changed
Fixes the following issue(s)
Relies on the following changes
APK testing
On the website the APK can be found by going to the "Checks" tab below the title and then on "artifacts" on the right.
You may also build/test it with this manual (click to open)
settings.gradle
Due diligence
Things that should be checked 👁️🗨️
Technical
I implemented these changes as good as i could think of.
However there the following topics/parts of the code should be checked carefully by the reviewers, because if it fails it may cause excessive problems:
Other behaviors and implementations that should be looked upon