Flutter Audio Player

flutter audio player package

audio player flutter package that provides an easy widgets to have audio player that can play remote or local audio files across all platforms


## Features * easy to use audio players with background service using widgets: - MinimalAudioPlayer: just an audio player to play audio with no controles of on play & pause button . - BasicAudioPlayer: audio player with seekbar and controle buttons - FullAudioPlayer: audio player with all features seek bar , controles , playlist , and art image .

Getting started

1. depend on it

    sdk: flutter
    # add this line 👇
  easy_audio_player: {latest_version}

2. platform setup

android setup

after the 'manifest' tag and before the 'application' tag add these permissions .

   <!-- Just audio background PERMISSIONS -->
 <uses-permission android:name="android.permission.WAKE_LOCK"/>
 <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>

then change the 'activity' tag

change this:


to this


then after 'activity' tag and before the end of 'application tag ' add this :

 <!--  ADD THIS "SERVICE" element -->
   <service android:name="com.ryanheise.audioservice.AudioService">
       <action android:name="android.media.browse.MediaBrowserService" />

   <!-- ADD THIS "RECEIVER" element -->
   <receiver android:name="com.ryanheise.audioservice.MediaButtonReceiver" >
       <action android:name="android.intent.action.MEDIA_BUTTON" />

IOS setup

Insert this in your Info.plist file:



  1. call initJustAudioBackground as early as possible
void main() async {
  // init the background service to display notifications while playing
  await initJustAudioBackground(NotificationSettings(androidNotificationChannelId: 'com.example.example'));
    home: HomeScreen(),
  1. load your audios in a ConcatenatingAudioSource playlist containing an AudioSource or one of it's inherted classes .

  final ConcatenatingAudioSource _playlist = ConcatenatingAudioSource(children: [
        tag: MediaItem(
            id: '1',
            artUri: Uri.parse('https://picsum.photos/300/300'),
            title: 'Audio Title ',
            album: 'amazing album'))
  1. call one of the players widgets with your playlist and options
return Scaffold(
        body: SafeArea(
            child: Padding(
                padding: const EdgeInsets.all(20.0),
                child: Center(
                  child: FullAudioPlayer(autoPlay: false, playlist: _playlist),