-
Notifications
You must be signed in to change notification settings - Fork 141
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
Add toggleable blurred coverart player background #273
Conversation
This looks really nice, much more interesting than the boring black/white background! The settings likely aren't working because there Hive wants a default value for I also noticed some weird behaviour when closing the player screen on iOS, I'll check to see if the same thing happens on Android. The low contrast probably isn't too much of an issue - we could change some text colours if it makes sense. I did try messing about with blurred images really early on in Finamp's development (The widget still exists at |
Thanks for pointing out what was missing, there were so many places to adjust just to get a toggle in settings lol. I've decided to make this feature turned on by default, improves discoverability of it a bit, and it's easy to permanently turn off now. I haven't observed any weird behaviors on Android. |
Yeah, FinampSettings is a bit cluttered lol. As far as I know there aren't any prebuilt solutions for settings, so I just threw something together. I've reimplemented the blurred background with a BlurHash, which should be faster and doesn't have the weird behaviour on iOS. It looks like flutter_blurhash has gotten better since I last looked (it now calculates the blur on another thread, before it caused really bad frame drops), so maybe I'll make AlbumImage use BlurHashes while the image is being fetched. One tiny improvement that would be nice would be fading between backgrounds when a track changes. AlbumImage gets away by fading in new images, but in its current state the background changes abruptly. |
Thanks for working on this PR lol. I forgot that other clients use blurhashes already, and initially thought it would be a great idea to reuse them, but right away I noticed that the blurhash background can sometimes look awful: I suppose lower "source resolution" of blurhashes is to blame here. Using full res images for blur avoided the white color spill, as seen in original screenshot in this PR. |
Yeah, blurring the images in Flutter does look better but the iOS issue makes it unfeasible. I'll record a video in a minute of the issue happening. |
Here's what's happening on iOS. Looks like it's stretching because the image isn't the right aspect ratio or something Simulator.Screen.Recording.-.iPhone.13.-.2022-07-27.at.20.23.11.mp4 |
Looks like it may be related to this: flutter/flutter#31706 (comment). It would also explain why the filter applies under the AppBar without |
If we do add back an ImageFilter based solution later, it may be a good idea to extract AlbumImage into an image provider so that we don't have to grab the same image twice from Jellyfin. It would also be pretty satisfying watching both images fade in at exactly the same time 🙃 |
Unless it's video compression causing the effect, it seems like the blurred image in background keeps moving as you're swiping the player screen away. That made me guess it's just square album image being scaled up to fit height and not having left and right sides cropped. It doesn't manifest itself on Android (no horizontal gesture), but on iOS it's just being dragged away along with the other items on player screen until entire screen is removed. Maybe just cropping it to screen aspect ratio would help? |
I tested with a Container that was set to the screen size and it still happened |
Won't container expand to fit child inside anyway? Maybe try setting blur value to 0 and check if it's indeed whole image being dragged, or if it's something else. (I'll look into getting a Hackintosh to test iOS issues like those at some point) |
Here's a recording of a Container wrapped in a 100x100 sized box (with the ImageFiltered highlighted with devtools) and what it looks like with a blur of 0. Simulator.Screen.Recording.-.iPhone.13.-.2022-07-27.at.21.07.04.mp4Simulator.Screen.Recording.-.iPhone.13.-.2022-07-27.at.21.11.03.mp4Also Hackintoshes are fun, highly recommended if you're bored and have compatible hardware :) |
I've always wanted to make NowPlayingBar properly slide in with the player screen as an animation, which would in theory get past the iOS transition issue. Sweyer has the look I want, and I did try to implement it (even asked how they did it lol), but I never managed to do it since it's quite hard to implement. I could have a look into it again though. |
Another way to get some colors from cover art on background is taking average color from blurhash. That won't cause any artifacts like on Gravity album cover. Ignore artifacts caused by mpv-webm encoding on videos below. screen-20220821-012337-.00.00.000-00.20.589.mp4screen-20220821-012705-.00.00.000-00.14.209.mp4To make it a bit fancier we could do some gradient using avg colors from blurhash corners or edges (a bit like Plexamp?), but I haven't figured that out yet. |
@rom4nik I'm currently investigating how to extract colors from the album covers and blurhashes. The problem with using the average color is that it can end up looking pretty dull, at least when using it as an accent color and not a background. But maybe the average color can be used as a background for thr blurhash in order to make it stand out less. I'll play around with it :) |
Note that it would probably be a good idea for us to abstract out |
This should be ready now - I've reworked |
Key issue has been fixed, had to make sure to update the future in |
A bit of eye candy, disabled by default. 2nd row has dark mode, 3rd row has light mode.
Some issues: