Skip to content
This repository was archived by the owner on Jan 20, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ build/
ios/.generated/
packages
pubspec.lock
example/android/**
**/android/.project

Podfile
Podfile.lock
Expand Down
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,27 @@ A Flutter audio plugin (ObjC/Java) to play remote or local audio files
- [x] onDuration / onCurrentPosition
- [x] seek
- [x] mute

![screenshot](https://www.evernote.com/shard/s1/sh/c9e2e0dc-4e1b-4797-b23f-2bdf0f6f3387/d1138680d3b4bdcd/res/1afa2507-2df2-42ef-a840-d7f3519f5cb3/skitch.png?resizeSmall&width=320)
- [x] Android ONLY
- [x] music session with controls (50% done)
- [x] music session creation
- [x] play, pause, stop, seek controls
- [ ] metadata broadcasting*
- [ ] next, previous, queue management*
- [ ] mediaBrowser for car/wear os library*
- [x] audioFocus management
- [x] requesting focus
- [x] focus loss management


## Usage

[Example](https://github.com/rxlabz/audioplayer/blob/master/example/lib/main.dart)
[Example](https://github.com/moda20/audioplayer/blob/master/example/lib/main.dart)

Also used in [TuneIn](https://github.com/moda20/flutter-tunein)

To use this plugin :

- Add the dependency to your [pubspec.yaml](https://github.com/rxlabz/audioplayer/blob/master/example/pubspec.yaml) file.
- Add the dependency to your [pubspec.yaml](https://github.com/moda20/audioplayer/blob/master/example/pubspec.yaml) file.

```yaml
dependencies:
Expand Down Expand Up @@ -107,7 +118,7 @@ By default iOS forbids loading from non-https url. To cancel this restriction ed
## Troubleshooting

- If you get a MissingPluginException, try to `flutter build apk` on Android, or `flutter build ios`
- to use the plugin in a ObjC iOS project, add 'use_frameworks!' to your podfile cf. [example](https://github.com/rxlabz/audioplayer/blob/master/example/ios/Podfile)
- to use the plugin in a ObjC iOS project, add 'use_frameworks!' to your podfile cf. [example](https://github.com/moda20/blob/master/example/ios/Podfile)

## Getting Started

Expand Down
17 changes: 17 additions & 0 deletions android/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>android__</name>
<comment>Project android__ created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
13 changes: 13 additions & 0 deletions android/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(5.6.1))
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true
20 changes: 14 additions & 6 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,37 @@ version '1.0-SNAPSHOT'
buildscript {
repositories {
jcenter()
google()
}

dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.android.tools.build:gradle:3.2.1'
}
}

allprojects {
repositories {
jcenter()
google()
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion 25
buildToolsVersion '25.0.3'

defaultConfig {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
minSdkVersion 21
}
lintOptions {
disable 'InvalidPackage'
}
}

dependencies {
implementation 'androidx.core:core:1.1.0'
implementation 'androidx.media:media:1.1.0'
}

1 change: 1 addition & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
10 changes: 8 additions & 2 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
package="bz.rxla.audioplayer"
android:versionCode="1"
android:versionName="0.1.0">

<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="21" />
<application>
<service android:name=".AudioplayerPlugin"
android:label="MediaService" >
<intent-filter>
<action android:name="android.media.browse.MediaBrowserService" />
</intent-filter>
</service>
</application>
</manifest>
Loading