You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Not all tracks in my situation have an art image and that makes the Android notification layout different if an image url is provided or null. It makes it hard to skip a lot of tracks because layout jumps around and you have to move your finger a lot.
Some android versions I've seen (eg MIUI) even cache images that are removed from Android media items and show them even if current item does not have art image.
Describe the solution you'd like
I'd like to have an option to specify an abstract fallback image for tracks that don't have an image so that layout of notification is preserved. The most suitable place I can see for this option specification is one more param for AudioService.start(). It might be a string that contains Android or even Flutter resource name since they are available on Android side.
Describe alternatives you've considered
Since you cannot get a file url to a Flutter or Android resource it's pretty straightforward that I need to fill a missing artUri with a file:// path to an image pre-copied into app storage. But user can clean app storage so I need to check if the fallback art is copied on every launch which is sophisticated. Also it requires me to write platform code.
Additional context
Following GIF illustrates the case of layout jumps around.
The text was updated successfully, but these errors were encountered:
Since artwork is currently handled with URIs, I would prefer this to also be done through a URI rather than a Flutter asset. Note that audio_service uses flutter_cache_manager to fetch the art from URIs, so in fact you can also host the placeholder artwork at a remote URL and the first time it's needed it will be cached by flutter_cache_manager and then the local cached file will be automatically used thereafter.
So a simple solution to your issue is to host the placeholder art elsewhere, and then for each media item that doesn't have an artwork, pass in the URI for your placeholder. If you prefer not to load any remote URLs, then yes you'll need some application logic in your onStart to check for the existence of your local placeholder file, and if it doesn't exist, fetch it from Flutter assets.
I do think a placeholder URI could be a useful feature, though, so I'll leave this feature request open. But in the meantime, you should at least be able to work around it with application code.
Is your feature request related to a problem? Please describe.
Not all tracks in my situation have an art image and that makes the Android notification layout different if an image url is provided or null. It makes it hard to skip a lot of tracks because layout jumps around and you have to move your finger a lot.
Some android versions I've seen (eg MIUI) even cache images that are removed from Android media items and show them even if current item does not have art image.
Describe the solution you'd like
I'd like to have an option to specify an abstract fallback image for tracks that don't have an image so that layout of notification is preserved. The most suitable place I can see for this option specification is one more param for
AudioService.start()
. It might be a string that contains Android or even Flutter resource name since they are available on Android side.Describe alternatives you've considered
Since you cannot get a file url to a Flutter or Android resource it's pretty straightforward that I need to fill a missing artUri with a
file://
path to an image pre-copied into app storage. But user can clean app storage so I need to check if the fallback art is copied on every launch which is sophisticated. Also it requires me to write platform code.Additional context
Following GIF illustrates the case of layout jumps around.
The text was updated successfully, but these errors were encountered: