2

This question is specifically related to the Audio Service package in flutter. Till v0.17.0 there was a lock screen art but it's not there in v0.18.0. So, I just wanted to know if there's any specific method by which I can enable as well as disable it. I checked and wasn't able to find any such input parameter for that.

Ankit Sangwan
  • 1,138
  • 1
  • 7
  • 20
  • Lock screen art wasn't removed in 0.18.0, so if you find official example has no lock screen art, you should probably report it as a bug. As for how to enable and disable it, you do this by either providing an `artUri` or not providing one in your `MediaItem`. – Ryan Heise Oct 08 '21 at 12:52
  • @RyanHeise Before 0.18.0 lockscreen art was there. Also, if I don't provide artUri then it won't even showup in notification and all. I specifically want it to hide blurred background album art in lockscreen. Like there are music apps which allow users to hide lockscreen art. – Ankit Sangwan Oct 11 '21 at 04:15
  • So have you reported the bug yet? – Ryan Heise Oct 11 '21 at 05:38
  • Nope, haven't reported anything yet – Ankit Sangwan Oct 11 '21 at 06:50
  • Just reminding you ;-) If you find the official example has no lock screen art, that's a bug in the plugin. If on the other hand the official example works, then it's not a bug (but then you also have your answer, as you can just use the example as a reference.) – Ryan Heise Oct 11 '21 at 11:31
  • One more thing is that Google has officially removed support for displaying album art on the lock screen as of Android 11, so it might not be worth submitting a bug report after all, unless you can make a case that it's important to support the old way for users on older phones. – Ryan Heise Oct 11 '21 at 13:07

1 Answers1

0

As of Android 11, Google removed support for displaying the album art as the lock screen background, and this feature is also not available in audio_service as of 0.18.0. (Although it could theoretically be supported on older versions of Android, it's probably for the best that it's not, since that feature required holding and transporting high resolution bitmaps in Android's media session which was not efficient.)

Ryan Heise
  • 2,273
  • 5
  • 14
  • I see. But they only removed image ig. They do show the dominant color from image as lockscreen background. But in v0.18.0 nothing is shown at all. – Ankit Sangwan Oct 12 '21 at 03:06
  • That may be a side effect of the fact that this feature was removed in 0.18.0. If it's important for you to have this feature on older versions of Android still, then please test this pull request: https://github.com/ryanheise/audio_service/pull/843 – Ryan Heise Oct 12 '21 at 07:43
  • Ok thanks. One more thing, is it possible to add an option to switch between two types of album art design. Like in android 11 the album art is shown on left side inside a small square and rest metadata on right side. But some apps like Spotify support a toggle to switch to [this kind of design](https://m.imgur.com/a/OtcOO16) – Ankit Sangwan Oct 14 '21 at 03:31
  • It is theoretically possible if I created a custom notification rather than using the standard MediaStyle notification. It's not something I'd personally want to do (if anything, I'd go for exposing a Java API to allow custom Java code to create your own notification), although if you want such a feature you can submit a feature request. – Ryan Heise Oct 14 '21 at 14:31