music_player 0.1.5 music_player: ^0.1.5 copied to clipboard
A flutter plugin to enable music playback with the native iOS and Android control centers.
Music Player #
A music player flutter plugin that uses the native api to show the currently playing track with cover image and controls.
WARNING #
This plugin is still in development
Prerequisites #
Android:
- Android 5.0 Lollipop (API 21) or higher
- Kotlin support
- AndroidX compatibility
iOS:
- Swift support
- iOS 10.* or higher, because of some newly introduced audio playback features
Usage #
A sample project can be found in the example
folder.
Additional installation steps #
Android #
- Set the
minSdkVersion
inandroid/app/build.gradle
to 21 - Migrate to AndroidX
- Add Kotlin support (In AndroidStudio "Refactor > Migrate to AndroidX..")
- Add the
FOREGROUND_SERVICE
permission and theMusicPlayerService
toandroid/app/src/main/AndroidManifest.xml
(see below)
<manifest xmlns:android="..." package="...">
<!-- Add following permission -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<application>
...
<activity>...</activity>
<!-- Add the following service -->
<service
android:name="live.exit.musicplayer.MusicPlayerService"
android:enabled="true" />
</application>
</manifest>
iOS #
TODO