az_player_plugin 0.0.12

  • Readme
  • Changelog
  • Example
  • Installing
  • 61

az_player_plugin #

A flutter player plugin for Android and iOS.

This plugin handle background mode playing, for music and video.

Add notification player in notification center and lock screen. Support both android/iOS.

Getting Started #

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Android #

Step 1. android/app/AndroidManifest.xml

1.1. add code below:

`<service android:name="pro.zahedi.flutter.plugin.player.az_player_plugin.AudioService"



1.2. in Application section:


1.3. in Application section, add the permission for foreground service:

<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

Step 2. android/app/build.graddle

2.1. Add the following dependency

`android { compileOptions {

                sourceCompatibility JavaVersion.VERSION_1_8
                targetCompatibility JavaVersion.VERSION_1_8

Troubleshooting #

Android X compatibility. #

If you have an error about android x compatibility, please visit the Flutter AndroidX compatibility.

iOS #

Step 1. Background mode #

Active background mode in show as a picture:

background mode

Step 2. ios/Runner/Info.plist

Before the </dict> </plist> add:

2.1. Allow access the internet for play link:



2.2. Allow show embedded flutter view:



Step 3. #

3.1. Choose the application name.

3.2. Minimum SDK is 10.0

minimum sdk

Troubleshooting #

The base flutter project must be swift project.

If you want to migrate to swift project from objective-c. It's easy, you can follow this step in Stack overflow

Usage #

See here for usage.


  • [ ] get play list

  • [ ] fast forward in iOS

  • [ ] fast backward in iOS

  • [ ] handle update client. like call back or interval for update timer, slider, play/pause button in framework.

Please rate/star and contribute if you find it helpfull. #

0.0.12 #

  • Fix some issue

0.0.11 #

  • Add header for kotlin register to java plugin

0.0.10 #

  • Fix run on ios 13

0.0.9 #

  • Convert main android file to kotlin

0.0.7 #

  • Add placeholder for audio file

  • Add fast forward and fast backward in iOS version

  • Fix close notification in android

  • Add aspect ratio for get player view

0.0.6 #

  • Get current file

0.0.5 #

  • Update readme

0.0.4 #

  • Update readme

0.0.3 #

  • Update readme

0.0.2 #

  • Update readme

0.0.1 #

  • Initial


az_player_plugin_example #

You can follow and see git hub repository.

Please rate/start and contribute if find it helpful.

Usage #

import package:

import 'package:az_player_plugin/az_player_plugin.dart' as AZPlayerPlugin;

Define File #

var file = AZPlayerPlugin.File( 0, "", "title", 0, AZPlayerPlugin.FileStatus.ready, "", );

Add file to play list #

  1. Add one file:


  1. Add multi file:


Note: file/files append together in playlist.

Core functionality #

  1. play :




  1. pause:


  1. get total time of file is playing:


  1. get time left:


  1. get current time:


  1. file is playing?


  1. get player view to attach your custom view:

AZPlayerPlugin.AzPlayerPlugin().getPlayerView(width: 300, height: 100);



  1. stop:


  1. fastForward, current time +15 seconds:


  1. fastBackward, current time - 5 seconds:


  1. emptyPlayList, command for delete all files in playlist:


  1. removeFromPlayList, remove special file from playlist:


  1. next track:


  1. previous track:


  1. change time to special second:


You must read every one seconds to update your player, like (slider, timer and etc to update time).

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  az_player_plugin: ^0.0.12

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:az_player_plugin/az_player_plugin.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 16, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health issues and suggestions

Document public APIs. (-0.63 points)

79 out of 80 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/player_plugin.dart. (-0.50 points)

Analysis of lib/player_plugin.dart reported 1 hint:

line 135 col 5: Avoid empty statements.

Format lib/file.dart.

Run flutter format to format lib/file.dart.

Format lib/file_status.dart.

Run flutter format to format lib/file_status.dart.

Fix additional 3 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/interfaces/interface_file.dart (Run flutter format to format lib/interfaces/interface_file.dart.)
  • lib/interfaces/interface_player.dart (Run flutter format to format lib/interfaces/interface_player.dart.)
  • lib/interfaces/interfaces.dart (Run flutter format to format lib/interfaces/interfaces.dart.)

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies