music_player 0.0.8 music_player: ^0.0.8 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.
This plugin is still in development.
Warning: This plugin is written in Swift and Kotlin, so make sure your project is setup to compile these languages.
The required iOS version for this plugin is
10.*
because some features to control the audio playback have only been introduced there. The required Android version is Android 8.0 Oreo (API 26) or higher
Usage #
A simple usage example
For Android make sure to add <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
and
<service android:enabled="true" android:name="live.exit.musicplayer.MusicPlayerService" />
to the
AndroidManifest.xml
of your Flutter app.
If you want to provide a custom notification icon, add the asset to assets/images/notification_icon.png
in your Flutter app (don't forget to also add it to the pubspec.yaml
).