florent37 / Flutter-AssetsAudioPlayer

Play simultaneously music/audio from assets/network/file directly from Flutter, compatible with android / ios / web / macos, displays notifications
https://pub.dartlang.org/packages/assets_audio_player
Apache License 2.0
739 stars 336 forks source link

Optional change icon on background player #115

Closed vladimirlapikov closed 4 years ago

vladimirlapikov commented 4 years ago

Hi , it will be helpful to add control over an icon of background player to change the default icon to my app icon for example thnx again :)

florent37 commented 4 years ago

It will be dificult because you have to give on Android a resource icon (like the launcher icon)

I think the simplest way to provide it is to add a manifest extra field which will refer to the notification icon (like how firebase does)

vladimirlapikov commented 4 years ago

Thanks,I"ll check it

florent37 commented 4 years ago

For now it's not implemented but I'll try to add this field. It will not be configurable from flutter but from the Android manifest

florent37 commented 4 years ago

just added

in your android/app/src/main/AndroidManifest.xml

add

<meta-data
            android:name="assets.audio.player.notification.icon"
            android:resource="@drawable/ic_music_custom"/>

here ic_music_custom is a drawable I added into android resources, like the launcher icon

florent37 commented 4 years ago

I pushed it in 1.6.2

florent37 commented 4 years ago

(meta data goes inside application)

     ...

     <meta-data
            android:name="assets.audio.player.notification.icon"
            android:resource="@drawable/ic_music_custom"/>

    </application>
</manifest>
vladimirlapikov commented 4 years ago

thank you very very much :)))))

florent37 commented 4 years ago

You're welcome thanks for using this lib and pushing issues :)