Open arshrahman opened 3 years ago
Minimal reproduction project Save an image to the
NSApplicationSupportDirectory
of iOS. This can be done by callinggetApplicationSupportDirectory()
function ofpath_provider
package.
Can you do that and then provide me with a link that I can clone and run?
Here's a minimal project setup reproducing the error: https://github.com/arshrahman/audio_service
I just basically modified the example audio_service project to get a local artUri for the first MediaItem
in the MediaLibrary
class. All the changes are only in MediaLibrary
class. There are two MediaItems
. The first one has a local art uri and the second one has web image url. Both images are shown in Android media notification. However, only the web image is shown for iOS media notification.
Thanks, @arshrahman . Just to check, are you testing on a Simulator or an actual iPhone device?
Because there is a space in Application%20Support
it is getting URL-encoded. But I'm not sure if the path on a real iPhone device will have the same problem.
My focus is now on the upcoming 0.18.0 release which should already have this bug fixed, so if it is urgent for you, you may consider trying this out in its preview form.
I am using an actual iPhone device. iPhone 11 model. Actually, in the iOS simulator, the media notification doesn't show at all. Not sure, if i need to turn on some setting to show the media notification
I see. On the simulator it was possible to test these things using an older version of Xcode but this can't be used on the BigSur. But as per your answer, the bug is present on both the simulator and real devices.
As before, I would suggest trying out the upcoming 0.18.0 release if it is urgent for you.
I see, I am running Bug Sur. I will try out 0.18.0 release a little later as it needs some migration. This is a minor bug and it doesn't affect the functionality.
Test below code:
final artUri = await saveImagetoDevice();
AudioService.updateQueue([
MediaItem(
artUri: "file://$artUri"
)]);
@zhouyuanbo have you read my previous comment?
@arshrahman can you confirm whether the issue persists in 0.18.0?
I was trying artUri: Uri.file('assets/path-to-local-file.png')
on just_audio_background: 0.0.1-beta.1
.
Unfortunately the album art does not show up.
edit: it seems that I am trying to achieve something else. I would like to use an image asset bundled with the app. For those assets one can not obtain a path.
In addition to that Uri.file
does not do what I thought it would do, but creates a new file 🙃
@ma-pe have you found any solution to show artUri from assets folder?
@sanjay23singh that is not related to this issue. Please search for another existing issue for loading the artUri
from assets, or if one does not exist, submit one.
Which API doesn't behave as documented, and how does it misbehave? local artfile doesn't show in iOS. Web url works in iOS. Both local and web artUri is working in Android
Minimal reproduction project Save an image to the
NSApplicationSupportDirectory
of iOS. This can be done by callinggetApplicationSupportDirectory()
function ofpath_provider
package.example local artUri file in iOS:
file:///var/mobile/Containers/Data/Application/4CF715DR-502C-4B98-A41C-8EA319821SE6/Library/Application%20Support/category/1.png
Set MediaItem artUri to the local file Uri. Art Uri doesn't show in iOS media notification.Here's a minimal code to copying an asset image to
NSApplicationSupportDirectory
of iOS and get the uri.path_provider: ^2.0.1
topubspec.yaml
To Reproduce (i.e. user steps, not code) Steps to reproduce the behavior:
Expected behavior local artUri should also show in iOS media notification
Runtime Environment (please complete the following information if relevant):
Flutter SDK version
Package Version