az_player_plugin 0.2.13
az_player_plugin: ^0.2.13 copied to clipboard
A Flutter player plugin
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.
Support Repeat and shuffle mode.
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" android:enabled="true"
android:exported="false">
`
1.2. in Application section:
android:usesCleartextTraffic="true"
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:
`
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
`
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.
TODO:
-
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.