-
-
-
-
-
-
-
- playlistIndex + 1
- Dart
- EXPRESSION
-
-
- playlistIndex + 1 <= playlist.assetAudioPaths.length
- Dart
- EXPRESSION
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/flutter_assetsAudioPlayer/.metadata b/packages/flutter_assetsAudioPlayer/.metadata
deleted file mode 100644
index fbc1f395..00000000
--- a/packages/flutter_assetsAudioPlayer/.metadata
+++ /dev/null
@@ -1,10 +0,0 @@
-# This file tracks properties of this Flutter project.
-# Used by Flutter tool to assess capabilities and perform upgrades etc.
-#
-# This file should be version controlled and should not be manually edited.
-
-version:
- revision: 5391447fae6209bb21a89e6a5a6583cac1af9b4b
- channel: beta
-
-project_type: plugin
diff --git a/packages/flutter_assetsAudioPlayer/CHANGELOG.md b/packages/flutter_assetsAudioPlayer/CHANGELOG.md
deleted file mode 100644
index 2e26b3c6..00000000
--- a/packages/flutter_assetsAudioPlayer/CHANGELOG.md
+++ /dev/null
@@ -1,21 +0,0 @@
-## 1.2.4
-
-* Added playlist
-
-## 1.2.3
-
-* Added playlist (beta)
-
-## 1.2.1
-
-* Added looping setter/getter
-
-## 1.2.0
-
-* Upgraded RxDart to 0.23.1
-* Fixed assets playing on iOS
-* Fixed playing location on Android
-
-## 0.0.1
-
-* initial release.
diff --git a/packages/flutter_assetsAudioPlayer/LICENSE b/packages/flutter_assetsAudioPlayer/LICENSE
deleted file mode 100644
index d9e3d01d..00000000
--- a/packages/flutter_assetsAudioPlayer/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright 2019 Florent37
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/packages/flutter_assetsAudioPlayer/README.md b/packages/flutter_assetsAudioPlayer/README.md
deleted file mode 100644
index 6543c7cf..00000000
--- a/packages/flutter_assetsAudioPlayer/README.md
+++ /dev/null
@@ -1,149 +0,0 @@
-# assets_audio_player
-
-[![pub package](https://img.shields.io/pub/v/assets_audio_player.svg)](
-https://pub.dartlang.org/packages/assets_audio_player)
-
-Play music/audio stored in assets files directly from Flutter.
-
-No needed to copy songs to a media cache, with assets_audio_player you can open them directly from the assets.
-
-1. Create an audio directory in your assets (not necessary named "audios")
-2. Declare it inside your pubspec.yaml
-
-```yaml
-flutter:
- assets:
- - assets/audios/
-```
-
-## Getting Started
-
-```Dart
-final assetsAudioPlayer = AssetsAudioPlayer();
-
-assetsAudioPlayer.open(
- Audio("assets/audios/song1.mp3"),
-);
-```
-
-```Dart
-assetsAudioPlayer.playOrPause();
-assetsAudioPlayer.play();
-assetsAudioPlayer.pause();
-```
-
-```Dart
-assetsAudioPlayer.seek(Duration to);
-```
-
-```Dart
-assetsAudioPlayer.stop();
-```
-
-# Playlist
-```Dart
-assetsAudioPlayer.open(
- Playlist(
- assetAudioPaths: [
- "assets/audios/song1.mp3",
- "assets/audios/song2.mp3"
- ]
- )
-);
-
-assetsAudioPlayer.next();
-assetsAudioPlayer.prev();
-assetsAudioPlayer.playAtIndex(1);
-```
-
-## Listeners
-
-All listeners exposes Streams
-Using RxDart, AssetsAudioPlayer exposes some listeners as ValueObservable (Observable that provides synchronous access to the last emitted item);
-
-### Current song
-```Dart
-//The current playing audio, filled with the total song duration
-assetsAudioPlayer.current //ValueObservable
-
-//Retrieve directly the current played asset
-final PlayingAudio playing = assetsAudioPlayer.current.value;
-
-//Listen to the current playing song
-assetsAudioPlayer.current.listen((playingAudio){
- final asset = playingAudio.assetAudio;
- final songDuration = playingAudio.duration;
-})
-```
-
-### Current song duration
-
-```Dart
-//Listen to the current playing song
-final duration = assetsAudioPlayer.current.value.duration;
-```
-
-### Current position (in seconds)
-
-```Dart
-assetsAudioPlayer.currentPosition //ValueObservable
-
-//retrieve directly the current song position
-final Duration position = assetsAudioPlayer.currentPosition.value;
-
-return StreamBuilder(
- stream: assetsAudioPlayer.currentPosition,
- builder: (context, asyncSnapshot) {
- final Duration duration = asyncSnapshot.data;
- return Text(duration.toString());
- }),
-```
-
-### IsPlaying
-boolean observable representing the current mediaplayer playing state
-```Dart
-assetsAudioPlayer.isPlaying // ValueObservable
-
-//retrieve directly the current player state
-final bool playing = assetsAudioPlayer.isPlaying.value;
-
-//will follow the AssetsAudioPlayer playing state
-return StreamBuilder(
- stream: assetsAudioPlayer.isPlaying,
- builder: (context, asyncSnapshot) {
- final bool isPlaying = asyncSnapshot.data;
- return Text(isPlaying ? "Pause" : "Play");
- }),
-```
-
-### Finished
-
-Called when the current song has finished to play
-
-```Dart
-assetsAudioPlayer.finished //ValueObservable
-
-assetsAudioPlayer.finished.listen((finished){
-
-})
-```
-
-### Looping
-
-```Dart
-final bool isLooping = assetsAudioPlayer.loop; //true / false
-
-assetsAudioPlayer.loop = true; //set loop as true
-
-assetsAudioPlayer.isLooping.listen((loop){
- //listen to loop
-})
-
-assetsAudioPlayer.toggleLoop(); //toggle the value of looping
-```
-
-# Flutter
-
-For help getting started with Flutter, view our
-[online documentation](https://flutter.io/docs), which offers tutorials,
-samples, guidance on mobile development, and a full API reference.
diff --git a/packages/flutter_assetsAudioPlayer/android/.classpath b/packages/flutter_assetsAudioPlayer/android/.classpath
deleted file mode 100644
index eb19361b..00000000
--- a/packages/flutter_assetsAudioPlayer/android/.classpath
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/packages/flutter_assetsAudioPlayer/android/.gitignore b/packages/flutter_assetsAudioPlayer/android/.gitignore
deleted file mode 100644
index c6cbe562..00000000
--- a/packages/flutter_assetsAudioPlayer/android/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-*.iml
-.gradle
-/local.properties
-/.idea/workspace.xml
-/.idea/libraries
-.DS_Store
-/build
-/captures
diff --git a/packages/flutter_assetsAudioPlayer/android/.idea/.name b/packages/flutter_assetsAudioPlayer/android/.idea/.name
deleted file mode 100644
index 4d35115d..00000000
--- a/packages/flutter_assetsAudioPlayer/android/.idea/.name
+++ /dev/null
@@ -1 +0,0 @@
-assets_audio_player
\ No newline at end of file
diff --git a/packages/flutter_assetsAudioPlayer/android/.idea/caches/build_file_checksums.ser b/packages/flutter_assetsAudioPlayer/android/.idea/caches/build_file_checksums.ser
deleted file mode 100644
index 010be040..00000000
Binary files a/packages/flutter_assetsAudioPlayer/android/.idea/caches/build_file_checksums.ser and /dev/null differ
diff --git a/packages/flutter_assetsAudioPlayer/android/.idea/codeStyles/Project.xml b/packages/flutter_assetsAudioPlayer/android/.idea/codeStyles/Project.xml
deleted file mode 100644
index 30aa626c..00000000
--- a/packages/flutter_assetsAudioPlayer/android/.idea/codeStyles/Project.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/flutter_assetsAudioPlayer/android/.idea/gradle.xml b/packages/flutter_assetsAudioPlayer/android/.idea/gradle.xml
deleted file mode 100644
index 47bd81ff..00000000
--- a/packages/flutter_assetsAudioPlayer/android/.idea/gradle.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/flutter_assetsAudioPlayer/android/.idea/misc.xml b/packages/flutter_assetsAudioPlayer/android/.idea/misc.xml
deleted file mode 100644
index 5662ddda..00000000
--- a/packages/flutter_assetsAudioPlayer/android/.idea/misc.xml
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/flutter_assetsAudioPlayer/android/.idea/modules.xml b/packages/flutter_assetsAudioPlayer/android/.idea/modules.xml
deleted file mode 100644
index a8da0d71..00000000
--- a/packages/flutter_assetsAudioPlayer/android/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/flutter_assetsAudioPlayer/android/.idea/runConfigurations.xml b/packages/flutter_assetsAudioPlayer/android/.idea/runConfigurations.xml
deleted file mode 100644
index 7f68460d..00000000
--- a/packages/flutter_assetsAudioPlayer/android/.idea/runConfigurations.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/flutter_assetsAudioPlayer/android/.project b/packages/flutter_assetsAudioPlayer/android/.project
deleted file mode 100644
index 91e6302e..00000000
--- a/packages/flutter_assetsAudioPlayer/android/.project
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
- assets_audio_player
- Project assets_audio_player created by Buildship.
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.buildship.core.gradleprojectbuilder
-
-
-
-
-
- org.eclipse.jdt.core.javanature
- org.eclipse.buildship.core.gradleprojectnature
-
-
diff --git a/packages/flutter_assetsAudioPlayer/android/.settings/org.eclipse.buildship.core.prefs b/packages/flutter_assetsAudioPlayer/android/.settings/org.eclipse.buildship.core.prefs
deleted file mode 100644
index 6aa97a90..00000000
--- a/packages/flutter_assetsAudioPlayer/android/.settings/org.eclipse.buildship.core.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-connection.project.dir=../example/android
-eclipse.preferences.version=1
diff --git a/packages/flutter_assetsAudioPlayer/android/build.gradle b/packages/flutter_assetsAudioPlayer/android/build.gradle
deleted file mode 100644
index f9462bb2..00000000
--- a/packages/flutter_assetsAudioPlayer/android/build.gradle
+++ /dev/null
@@ -1,44 +0,0 @@
-group 'com.github.florent37.assetsaudioplayer'
-version '1.0-SNAPSHOT'
-
-buildscript {
- ext.kotlin_version = '1.3.61'
- repositories {
- google()
- jcenter()
- }
-
- dependencies {
- classpath 'com.android.tools.build:gradle:3.3.2'
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- }
-}
-
-rootProject.allprojects {
- repositories {
- google()
- jcenter()
- }
-}
-
-apply plugin: 'com.android.library'
-apply plugin: 'kotlin-android'
-
-android {
- compileSdkVersion 28
-
- sourceSets {
- main.java.srcDirs += 'src/main/kotlin'
- }
- defaultConfig {
- minSdkVersion 16
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
- }
- lintOptions {
- disable 'InvalidPackage'
- }
-}
-
-dependencies {
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
-}
diff --git a/packages/flutter_assetsAudioPlayer/android/gradle.properties b/packages/flutter_assetsAudioPlayer/android/gradle.properties
deleted file mode 100644
index 8bd86f68..00000000
--- a/packages/flutter_assetsAudioPlayer/android/gradle.properties
+++ /dev/null
@@ -1 +0,0 @@
-org.gradle.jvmargs=-Xmx1536M
diff --git a/packages/flutter_assetsAudioPlayer/android/gradle/wrapper/gradle-wrapper.jar b/packages/flutter_assetsAudioPlayer/android/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index f6b961fd..00000000
Binary files a/packages/flutter_assetsAudioPlayer/android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ
diff --git a/packages/flutter_assetsAudioPlayer/android/gradle/wrapper/gradle-wrapper.properties b/packages/flutter_assetsAudioPlayer/android/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index 9a4163a4..00000000
--- a/packages/flutter_assetsAudioPlayer/android/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
diff --git a/packages/flutter_assetsAudioPlayer/android/gradlew b/packages/flutter_assetsAudioPlayer/android/gradlew
deleted file mode 100644
index cccdd3d5..00000000
--- a/packages/flutter_assetsAudioPlayer/android/gradlew
+++ /dev/null
@@ -1,172 +0,0 @@
-#!/usr/bin/env sh
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn () {
- echo "$*"
-}
-
-die () {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-nonstop=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
- NONSTOP* )
- nonstop=true
- ;;
-esac
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
- JAVACMD=`cygpath --unix "$JAVACMD"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=$((i+1))
- done
- case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-fi
-
-# Escape application args
-save () {
- for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
- echo " "
-}
-APP_ARGS=$(save "$@")
-
-# Collect all arguments for the java command, following the shell quoting and substitution rules
-eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
-
-# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
-if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
- cd "$(dirname "$0")"
-fi
-
-exec "$JAVACMD" "$@"
diff --git a/packages/flutter_assetsAudioPlayer/android/gradlew.bat b/packages/flutter_assetsAudioPlayer/android/gradlew.bat
deleted file mode 100644
index e95643d6..00000000
--- a/packages/flutter_assetsAudioPlayer/android/gradlew.bat
+++ /dev/null
@@ -1,84 +0,0 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windows variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
diff --git a/packages/flutter_assetsAudioPlayer/android/settings.gradle b/packages/flutter_assetsAudioPlayer/android/settings.gradle
deleted file mode 100644
index 805aa906..00000000
--- a/packages/flutter_assetsAudioPlayer/android/settings.gradle
+++ /dev/null
@@ -1 +0,0 @@
-rootProject.name = 'assets_audio_player'
diff --git a/packages/flutter_assetsAudioPlayer/android/src/main/AndroidManifest.xml b/packages/flutter_assetsAudioPlayer/android/src/main/AndroidManifest.xml
deleted file mode 100644
index e32a6e47..00000000
--- a/packages/flutter_assetsAudioPlayer/android/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
diff --git a/packages/flutter_assetsAudioPlayer/android/src/main/kotlin/com/github/florent37/assetsaudioplayer/AssetsAudioPlayerPlugin.kt b/packages/flutter_assetsAudioPlayer/android/src/main/kotlin/com/github/florent37/assetsaudioplayer/AssetsAudioPlayerPlugin.kt
deleted file mode 100644
index 0060b78a..00000000
--- a/packages/flutter_assetsAudioPlayer/android/src/main/kotlin/com/github/florent37/assetsaudioplayer/AssetsAudioPlayerPlugin.kt
+++ /dev/null
@@ -1,200 +0,0 @@
-package com.github.florent37.assetsaudioplayer
-
-import android.content.Context
-import android.media.MediaMetadataRetriever
-import android.media.MediaPlayer
-import android.os.Handler
-import io.flutter.plugin.common.MethodCall
-import io.flutter.plugin.common.MethodChannel
-import io.flutter.plugin.common.MethodChannel.MethodCallHandler
-import io.flutter.plugin.common.PluginRegistry.Registrar
-
-
-internal val METHOD_POSITION = "player.position"
-internal val METHOD_FINISHED = "player.finished"
-internal val METHOD_IS_PLAYING = "player.isPlaying"
-internal val METHOD_CURRENT = "player.current"
-internal val METHOD_NEXT = "player.next"
-internal val METHOD_PREV = "player.prev"
-
-class AssetsAudioPlayerPlugin(private val context: Context, private val channel: MethodChannel) :
- MethodCallHandler {
- companion object {
- @JvmStatic
- fun registerWith(registrar: Registrar) {
- val channel = MethodChannel(registrar.messenger(), "assets_audio_player")
- channel.setMethodCallHandler(AssetsAudioPlayerPlugin(registrar.context(), channel))
- }
- }
-
- // To handle position updates.
- private val handler = Handler()
-
- private var mediaPlayer: MediaPlayer? = null
-
- private val isPlaying: Boolean
- get() = mediaPlayer != null && mediaPlayer!!.isPlaying
-
- private val updatePosition = object : Runnable {
- override fun run() {
- mediaPlayer?.let { mediaPlayer ->
- try {
- if (!mediaPlayer.isPlaying) {
- handler.removeCallbacks(this)
- }
-
- // Send position (seconds) to the application.
- channel.invokeMethod(METHOD_POSITION, mediaPlayer.currentPosition / 1000)
-
- // Update every 300ms.
- handler.postDelayed(this, 300)
- } catch (e: Exception) {
- e.printStackTrace()
- }
- }
- }
- }
-
- override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) {
- when (call.method) {
- "isPlaying" -> {
- result.success(isPlaying)
- }
- "play" -> {
- play()
- result.success(null)
- }
- "pause" -> {
- pause()
- result.success(null)
- }
- "stop" -> {
- stop()
- result.success(null)
- }
- "seek" -> if (call.arguments != null) {
- if (call.arguments !is Int) {
- result.error("WRONG_FORMAT", "The specified argument must be an int.", null)
- }
- val to = call.arguments as Int
- seek(to)
- result.success(null)
- }
- "open" -> if (call.arguments != null) {
- if (call.arguments !is String) {
- if (call.arguments !is Int) {
- result.error("WRONG_FORMAT", "The specified argument must be an String.", null)
- }
- }
- open(
- call.arguments() as String,
- result
- )
- }
- else -> result.notImplemented()
- }
- }
-
- private fun stop() {
- mediaPlayer?.apply {
- // Reset duration and position.
- // handler.removeCallbacks(updatePosition);
- // channel.invokeMethod("player.duration", 0);
- channel.invokeMethod(METHOD_POSITION, 0)
-
- mediaPlayer?.stop()
- mediaPlayer?.release()
- channel.invokeMethod(METHOD_IS_PLAYING, false)
- handler.removeCallbacks(updatePosition)
- }
- mediaPlayer = null
- }
-
- private fun open(assetAudioPath: String?, result: MethodChannel.Result) {
- stop()
-
- var totalDurationSeconds = 0L
-
- this.mediaPlayer = MediaPlayer()
-
- try {
- val mmr = MediaMetadataRetriever()
-
- val afd = context.assets.openFd("flutter_assets/$assetAudioPath")
- mediaPlayer?.setDataSource(afd.fileDescriptor, afd.startOffset, afd.declaredLength)
-
- mmr.setDataSource(afd.fileDescriptor, afd.startOffset, afd.declaredLength)
-
- //retrieve duration in seconds
- val duration =
- mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION).toLong()
- totalDurationSeconds = (duration / 1000)
-
- mmr.release()
-
- afd.close()
- } catch (e: Exception) {
- channel.invokeMethod(METHOD_POSITION, 0)
- e.printStackTrace()
- result.error("OPEN", e.message, null)
- return
- }
-
- try {
- mediaPlayer?.setOnPreparedListener {
- play()
- }
- mediaPlayer?.prepare()
- } catch (e: Exception) {
- channel.invokeMethod(METHOD_POSITION, 0)
- e.printStackTrace()
- result.error("OPEN", e.message, null)
- return
- }
-
- // Send duration to the application.
- // channel.invokeMethod("platform.duration", mediaPlayer.getDuration() / 1000);
-
- mediaPlayer?.setOnCompletionListener {
- channel.invokeMethod(METHOD_FINISHED, null)
- channel.invokeMethod(METHOD_IS_PLAYING, false)
- }
-
- channel.invokeMethod(METHOD_CURRENT, mapOf("totalDuration" to totalDurationSeconds))
-
-
- //will be done on play
- //result.success(null);
- }
-
- private fun toggle() {
- if (isPlaying) {
- pause()
- } else {
- play()
- }
- }
-
- private fun play() {
- mediaPlayer?.apply {
- start()
- handler.post(updatePosition)
- channel.invokeMethod(METHOD_IS_PLAYING, true)
- }
- }
-
- private fun pause() {
- mediaPlayer?.apply {
- pause()
- handler.removeCallbacks(updatePosition)
- channel.invokeMethod(METHOD_IS_PLAYING, false)
- }
- }
-
- private fun seek(seconds: Int) {
- mediaPlayer?.apply {
- seekTo(seconds * 1000)
- channel.invokeMethod(METHOD_POSITION, currentPosition / 1000)
- }
- }
-}
diff --git a/packages/flutter_assetsAudioPlayer/assets_audio_player.iml b/packages/flutter_assetsAudioPlayer/assets_audio_player.iml
deleted file mode 100644
index 9ce32d51..00000000
--- a/packages/flutter_assetsAudioPlayer/assets_audio_player.iml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/packages/flutter_assetsAudioPlayer/ios/.gitignore b/packages/flutter_assetsAudioPlayer/ios/.gitignore
deleted file mode 100644
index 710ec6cf..00000000
--- a/packages/flutter_assetsAudioPlayer/ios/.gitignore
+++ /dev/null
@@ -1,36 +0,0 @@
-.idea/
-.vagrant/
-.sconsign.dblite
-.svn/
-
-.DS_Store
-*.swp
-profile
-
-DerivedData/
-build/
-GeneratedPluginRegistrant.h
-GeneratedPluginRegistrant.m
-
-.generated/
-
-*.pbxuser
-*.mode1v3
-*.mode2v3
-*.perspectivev3
-
-!default.pbxuser
-!default.mode1v3
-!default.mode2v3
-!default.perspectivev3
-
-xcuserdata
-
-*.moved-aside
-
-*.pyc
-*sync/
-Icon?
-.tags*
-
-/Flutter/Generated.xcconfig
diff --git a/packages/flutter_assetsAudioPlayer/ios/Assets/.gitkeep b/packages/flutter_assetsAudioPlayer/ios/Assets/.gitkeep
deleted file mode 100644
index e69de29b..00000000
diff --git a/packages/flutter_assetsAudioPlayer/ios/Classes/AssetsAudioPlayer.swift b/packages/flutter_assetsAudioPlayer/ios/Classes/AssetsAudioPlayer.swift
deleted file mode 100644
index f6e9dbaa..00000000
--- a/packages/flutter_assetsAudioPlayer/ios/Classes/AssetsAudioPlayer.swift
+++ /dev/null
@@ -1,190 +0,0 @@
-import Flutter
-import UIKit
-import AVFoundation
-
-public class SwiftAssetsAudioPlayerPlugin: NSObject, FlutterPlugin {
- public static func register(with registrar: FlutterPluginRegistrar) {
- let music = Music(messenger: registrar.messenger(), registrar: registrar)
- music.start()
- }
-
- public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
-
- }
-}
-
-class Music : NSObject, AVAudioPlayerDelegate {
-
- static let METHOD_POSITION = "player.position"
- static let METHOD_FINISHED = "player.finished"
- static let METHOD_IS_PLAYING = "player.isPlaying"
- static let METHOD_CURRENT = "player.current"
-
- let channel: FlutterMethodChannel
- let registrar: FlutterPluginRegistrar
- init(messenger: FlutterBinaryMessenger, registrar: FlutterPluginRegistrar) {
- self.channel = FlutterMethodChannel(name: "assets_audio_player", binaryMessenger: messenger);
- self.registrar = registrar
- }
-
- func log(_ message: String){
- channel.invokeMethod("log", arguments: message)
- }
-
- func start(){
- channel.setMethodCallHandler({(call: FlutterMethodCall, result: FlutterResult) -> Void in
- self.log(call.method + call.arguments.debugDescription)
- switch(call.method){
- case "isPlaying" :
- result(self.playing); break;
- case "play" : self.play();result(true); break;
- case "pause" : self.pause();result(true); break;
- case "stop" : self.stop();result(true); break;
- case "seek" : if(call.arguments is Int) {
- let pos = call.arguments as! Int;
- self.seek(to: pos);
- result(true);
- } else {
- result(FlutterError(code: "WRONG_FORMAT",
- message: "The specified argument must be an Int.",
- details: nil))
- }
- break;
- case "open" :
- if let assetPath = call.arguments as? String {
- self.open(assetPath: assetPath, result: result);
- } else {
- result(FlutterError(code: "WRONG_FORMAT",
- message: "The specified argument must be a string",
- details: nil))
- }
- break;
-
- default:
- result(FlutterMethodNotImplemented);
- break;
-
- }
- })
- }
-
- var _currentTime : TimeInterval = 0
- private var currentTime : TimeInterval {
- get {
- return _currentTime
- }
- set(newValue) {
- _currentTime = newValue
- self.channel.invokeMethod(Music.METHOD_POSITION, arguments: self._currentTime)
- }
- };
-
- var _playing : Bool = false
- private var playing : Bool {
- get {
- return _playing
- }
- set(newValue) {
- _playing = newValue
- self.channel.invokeMethod(Music.METHOD_IS_PLAYING, arguments: self._playing)
- }
- };
-
- var currentTimeTimer: Timer?
- var player: AVAudioPlayer?
-
- func audioPlayerDidFinishPlaying(_ player: AVAudioPlayer, successfully flag: Bool){
- self.channel.invokeMethod(Music.METHOD_FINISHED, arguments: true)
- }
-
- func open(assetPath: String, result: FlutterResult){
- let assetKey = registrar.lookupKey(forAsset: assetPath)
- guard let path = Bundle.main.path(forResource: assetKey, ofType: nil) else {
- log("resource not found \(assetKey)")
- result("");
- return
- }
-
- let url = URL(fileURLWithPath: path)
-// log("url: "+url.absoluteString)
- do {
-
- /* set session category and mode with options */
- if #available(iOS 10.0, *) {
- try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, mode: AVAudioSession.Mode.default, options: [])
- } else {
- try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, options: AVAudioSession.CategoryOptions.mixWithOthers)
- }
-
- try AVAudioSession.sharedInstance().setActive(true)
-
- /* The following line is required for the player to work on iOS 11. Change the file type accordingly */
- if #available(iOS 11.0, *) {
- self.player = try AVAudioPlayer(contentsOf: url, fileTypeHint: AVFileType.mp3.rawValue)
- } else {
- /* iOS 10 and earlier require the following line: */
- self.player = try AVAudioPlayer(contentsOf: url)
- }
-
- if(self.player == nil){
- //log("player is null");
- return
- }
-
- self.player?.prepareToPlay()
-
- self.currentTime = 0
- self.playing = false
-
- self.player?.delegate = self
-
- play()
-
- result(true);
- //log("play_ok");
-
- let asset = AVURLAsset(url: url, options: nil)
-
- let audioDurationSeconds = CMTimeGetSeconds(asset.duration)
-
- self.channel.invokeMethod(Music.METHOD_CURRENT, arguments: ["totalDuration": audioDurationSeconds])
-
- } catch let error {
- result(error);
- log(error.localizedDescription)
- print(error.localizedDescription)
- }
- }
-
- func pause(){
- self.player?.pause()
- self.playing = false
- self.currentTimeTimer?.invalidate()
- }
-
- func seek(to: Int){
- self.player?.currentTime = Double(to)
- }
-
- func stop(){
- self.player?.stop()
- self.playing = false
- self.currentTimeTimer?.invalidate()
- }
-
- func play(){
- self.player?.play()
- self.currentTimeTimer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(updateTimer), userInfo: nil, repeats: true)
- self.currentTimeTimer?.fire()
- self.playing = true
- }
-
- @objc func updateTimer(){
- //log("updateTimer");
- if let p = self.player {
- self.currentTime = p.currentTime
- }
- }
-
-}
-
diff --git a/packages/flutter_assetsAudioPlayer/ios/Classes/AssetsAudioPlayerPlugin.h b/packages/flutter_assetsAudioPlayer/ios/Classes/AssetsAudioPlayerPlugin.h
deleted file mode 100644
index 92dec077..00000000
--- a/packages/flutter_assetsAudioPlayer/ios/Classes/AssetsAudioPlayerPlugin.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#import
-
-@interface AssetsAudioPlayerPlugin : NSObject
-@end
diff --git a/packages/flutter_assetsAudioPlayer/ios/Classes/AssetsAudioPlayerPlugin.m b/packages/flutter_assetsAudioPlayer/ios/Classes/AssetsAudioPlayerPlugin.m
deleted file mode 100644
index 1d1672d7..00000000
--- a/packages/flutter_assetsAudioPlayer/ios/Classes/AssetsAudioPlayerPlugin.m
+++ /dev/null
@@ -1,8 +0,0 @@
-#import "AssetsAudioPlayerPlugin.h"
-#import
-
-@implementation AssetsAudioPlayerPlugin
-+ (void)registerWithRegistrar:(NSObject*)registrar {
- [SwiftAssetsAudioPlayerPlugin registerWithRegistrar:registrar];
-}
-@end
diff --git a/packages/flutter_assetsAudioPlayer/ios/assets_audio_player.podspec b/packages/flutter_assetsAudioPlayer/ios/assets_audio_player.podspec
deleted file mode 100644
index 763117ed..00000000
--- a/packages/flutter_assetsAudioPlayer/ios/assets_audio_player.podspec
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
-#
-Pod::Spec.new do |s|
- s.name = 'assets_audio_player'
- s.version = '0.0.1'
- s.summary = 'A new flutter plugin project.'
- s.description = <<-DESC
-A new flutter plugin project.
- DESC
- s.homepage = 'http://example.com'
- s.license = { :file => '../LICENSE' }
- s.author = { 'Your Company' => 'email@example.com' }
- s.source = { :path => '.' }
- s.source_files = 'Classes/**/*'
- s.public_header_files = 'Classes/**/*.h'
- s.dependency 'Flutter'
-
- s.ios.deployment_target = '8.0'
-end
-
diff --git a/packages/flutter_assetsAudioPlayer/lib/assets_audio_player.dart b/packages/flutter_assetsAudioPlayer/lib/assets_audio_player.dart
deleted file mode 100644
index 8d2d5256..00000000
--- a/packages/flutter_assetsAudioPlayer/lib/assets_audio_player.dart
+++ /dev/null
@@ -1,432 +0,0 @@
-import 'dart:async';
-
-import 'package:assets_audio_player/playing.dart';
-import 'package:flutter/cupertino.dart';
-import 'package:flutter/services.dart';
-import 'package:rxdart/rxdart.dart';
-import 'package:rxdart/subjects.dart';
-
-import 'playing.dart';
-export 'playing.dart';
-
-import 'playable.dart';
-export 'playable.dart';
-
-/// The AssetsAudioPlayer, playing audios from assets/
-/// Example :
-///
-/// AssetsAudioPlayer _assetsAudioPlayer = AssetsAudioPlayer();
-///
-/// _assetsAudioPlayer.open(Audio(
-/// "/assets/audio/myAudio.mp3",
-/// ))
-///
-/// Don't forget to declare the audio folder in your `pubspec.yaml`
-///
-/// flutter:
-/// assets:
-/// - assets/audios/
-///
-class AssetsAudioPlayer {
- /// The channel between the native and Dart
- final MethodChannel _channel = const MethodChannel('assets_audio_player');
-
- /// Stores opened asset audio path to use it on the `_current` BehaviorSubject (in `PlayingAudio`)
- String _lastOpenedAssetsAudioPath;
-
- _CurrentPlaylist _playlist;
-
- ReadingPlaylist get playlist {
- if (_playlist == null) {
- return null;
- } else {
- return ReadingPlaylist(
- //immutable copy
- audios: _playlist.playlist.audios,
- currentIndex: _playlist.playlistIndex,
- );
- }
- }
-
- /// Then mediaplayer playing state (mutable)
- final BehaviorSubject _isPlaying = BehaviorSubject.seeded(false);
-
- /// Boolean observable representing the current mediaplayer playing state
- ///
- /// retrieve directly the current player state
- /// final bool playing = _assetsAudioPlayer.isPlaying.value;
- ///
- /// will follow the AssetsAudioPlayer playing state
- /// return StreamBuilder(
- /// stream: _assetsAudioPlayer.currentPosition,
- /// builder: (context, asyncSnapshot) {
- /// final bool isPlaying = asyncSnapshot.data;
- /// return Text(isPlaying ? "Pause" : "Play");
- /// }),
- ValueStream get isPlaying => _isPlaying.stream;
-
- /// Then mediaplayer playing audio (mutable)
- final BehaviorSubject _current = BehaviorSubject();
-
- /// The current playing audio, filled with the total song duration
- /// Exposes a PlayingAudio
- ///
- /// Retrieve directly the current played asset
- /// final PlayingAudio playing = _assetsAudioPlayer.current.value;
- ///
- /// Listen to the current playing song
- /// _assetsAudioPlayer.current.listen((playing){
- /// final path = playing.audio.path;
- /// final songDuration = playing.audio.duration;
- /// })
- ///
- ValueStream get current => _current.stream;
-
- /// Called when the the complete playlist finished to play (mutable)
- final BehaviorSubject _playlistFinished =
- BehaviorSubject.seeded(false);
-
- /// Called when the complete playlist has finished to play
- /// _assetsAudioPlayer.finished.listen((finished){
- ///
- /// })
- ///
- ValueStream get playlistFinished => _playlistFinished.stream;
-
- /// Called when the current playlist song has finished (mutable)
- /// Using a playlist, the `finished` stram will be called only if the complete playlist finished
- /// _assetsAudioPlayer.playlistAudioFinished.listen((audio){
- /// the $audio has finished to play, moving to next audio
- /// })
- final PublishSubject _playlistAudioFinished = PublishSubject();
-
- /// Called when the current playlist song has finished
- /// Using a playlist, the `finished` stram will be called only if the complete playlist finished
- Stream get playlistAudioFinished => _playlistAudioFinished.stream;
-
- /// Then current playing song position (in seconds) (mutable)
- final BehaviorSubject _currentPosition =
- BehaviorSubject.seeded(const Duration());
-
- /// Retrieve directly the current song position (in seconds)
- /// final Duration position = _assetsAudioPlayer.currentPosition.value;
- ///
- /// return StreamBuilder(
- /// stream: _assetsAudioPlayer.currentPosition,
- /// builder: (context, asyncSnapshot) {
- /// final Duration duration = asyncSnapshot.data;
- /// return Text(duration.toString());
- /// }),
- Stream get currentPosition => _currentPosition.stream;
-
- final BehaviorSubject _loop = BehaviorSubject.seeded(false);
-
- /// Called when the looping state changes
- /// _assetsAudioPlayer.isLooping.listen((looping){
- ///
- /// })
- ///
- ValueStream get isLooping => _loop.stream;
-
- /// returns the looping state : true -> looping, false -> not looping
- bool get loop => _loop.value;
-
- /// assign the looping state : true -> looping, false -> not looping
- set loop(value) {
- _loop.value = value;
- }
-
- /// toggle the looping state
- /// if it was looping -> stops this
- /// if it was'nt looping -> now it is
- void toggleLoop() {
- loop = !loop;
- }
-
- /// Call it to dispose stream
- void dispose() {
- stop();
-
- _currentPosition.close();
- _isPlaying.close();
- _playlistFinished.close();
- _current.close();
- _playlistAudioFinished.close();
- _loop.close();
- }
-
- AssetsAudioPlayer() {
- _channel.setMethodCallHandler((MethodCall call) async {
- //print("received call ${call.method} with arguments ${call.arguments}");
- switch (call.method) {
- case 'log':
- print("log: " + call.arguments);
- break;
- case 'player.finished':
- _onfinished(call.arguments);
- break;
- case 'player.current':
- final totalDuration = _toDuration(call.arguments["totalDuration"]);
-
- final playingAudio = PlayingAudio(
- assetAudioPath: _lastOpenedAssetsAudioPath,
- duration: totalDuration,
- );
-
- if (_playlist != null) {
- _current.value = Playing(
- audio: playingAudio,
- index: _playlist.playlistIndex,
- hasNext: _playlist.hasNext(),
- playlist: ReadingPlaylist(
- audios: _playlist.playlist.audios,
- currentIndex: _playlist.playlistIndex),
- );
- }
- break;
- case 'player.position':
- if (call.arguments is int) {
- _currentPosition.value = Duration(seconds: call.arguments);
- } else if (call.arguments is double) {
- double value = call.arguments;
- _currentPosition.value = Duration(seconds: value.round());
- }
- break;
- case 'player.isPlaying':
- _isPlaying.value = call.arguments;
- break;
- default:
- print('[ERROR] Channel method ${call.method} not implemented.');
- }
- });
- }
-
- void playlistPlayAtIndex(int index) {
- _playlist.moveTo(index);
- _open(_playlist.currentAudioPath());
- }
-
- bool previous() {
- if (_playlist != null) {
- if (_playlist.hasPrev()) {
- _playlist.selectPrev();
- _open(_playlist.currentAudioPath());
- return true;
- } else if (_playlist.playlistIndex == 0) {
- seek(Duration.zero);
- return true;
- }
- }
-
- return false;
- }
-
- bool next({bool stopIfLast = false}) {
- if (_playlist != null) {
- if (_playlist.hasNext()) {
- _playlistAudioFinished.add(Playing(
- audio: this._current.value.audio,
- index: this._current.value.index,
- hasNext: true,
- playlist: this._current.value.playlist,
- ));
- _playlist.selectNext();
- _open(_playlist.currentAudioPath());
-
- return true;
- } else if (loop) {
- //last element
- _playlistAudioFinished.add(Playing(
- audio: this._current.value.audio,
- index: this._current.value.index,
- hasNext: false,
- playlist: this._current.value.playlist,
- ));
-
- _playlist.returnToFirst();
- _open(_playlist.currentAudioPath());
-
- return true;
- } else if (stopIfLast) {
- stop();
- return true;
- }
- }
- return false;
- }
-
- void _onfinished(bool isFinished) {
- bool nextDone = next(stopIfLast: false);
- if (nextDone) {
- _playlistFinished.value = false; //continue playing the playlist
- } else {
- _playlistFinished.value = true; // no next elements -> finished
- }
- }
-
- /// Converts a number to duration
- Duration _toDuration(num value) {
- if (value is int) {
- return Duration(seconds: value);
- } else if (value is double) {
- return Duration(seconds: value.round());
- } else {
- return Duration();
- }
- }
-
- //private method, used in open(playlist) and open(path)
- void _open(String assetAudioPath) async {
- if (assetAudioPath != null) {
- try {
- _channel.invokeMethod('open', assetAudioPath);
- } catch (e) {
- throw e;
- }
-
- _lastOpenedAssetsAudioPath = assetAudioPath;
- }
- }
-
- void _openPlaylist(Playlist playlist) async {
- this._playlist = _CurrentPlaylist(playlist: playlist);
- _playlist.moveTo(playlist.startIndex);
- _open(_playlist.currentAudioPath());
- }
-
- /// Open a song from the asset
- /// ### Example
- ///
- /// AssetsAudioPlayer _assetsAudioPlayer = AssetsAudioPlayer();
- ///
- /// _assetsAudioPlayer.open(Audio("assets/audios/song1.mp3"))
- ///
- /// Don't forget to declare the audio folder in your `pubspec.yaml`
- ///
- /// flutter:
- /// assets:
- /// - assets/audios/
- ///
- void open(Playable playable) async {
- if (playable is Playlist &&
- playable.audios != null &&
- playable.audios.length > 0) {
- _openPlaylist(playable);
- } else if (playable is Audio) {
- _openPlaylist(Playlist(audios: [playable]));
- } else {
- //do nothing
- //throw exception ?
- }
- }
-
- /// Toggle the current playing state
- /// If the media player is playing, then pauses it
- /// If the media player has been paused, then play it
- ///
- /// _assetsAudioPlayer.playOfPause();
- ///
- void playOrPause() async {
- final bool playing = _isPlaying.value;
- if (playing) {
- pause();
- } else {
- play();
- }
- }
-
- /// Tells the media player to play the current song
- /// _assetsAudioPlayer.play();
- ///
- void play() {
- _channel.invokeMethod('play');
- }
-
- /// Tells the media player to play the current song
- /// _assetsAudioPlayer.pause();
- ///
- void pause() {
- _channel.invokeMethod('pause');
- }
-
- /// Change the current position of the song
- /// Tells the player to go to a specific position of the current song
- ///
- /// _assetsAudioPlayer.seek(Duration(minutes: 1, seconds: 34));
- ///
- void seek(Duration to) {
- _channel.invokeMethod('seek', to.inSeconds.round());
- }
-
- /// Tells the media player to stop the current song, then release the MediaPlayer
- /// _assetsAudioPlayer.stop();
- ///
- void stop() {
- _channel.invokeMethod('stop');
- }
-
-//void shufflePlaylist() {
-// TODO()
-//}
-
- /// TODO Playlist Loop / Loop 1
-//void playlistLoop(PlaylistLoop /* enum */ mode) {
-// TODO()
-//}
-}
-
-class _CurrentPlaylist {
- final Playlist playlist;
-
- int playlistIndex = 0;
-
- int selectNext() {
- if (hasNext()) {
- playlistIndex += 1;
- }
- return playlistIndex;
- }
-
- int moveTo(int index) {
- if (index < 0) {
- playlistIndex = 0;
- } else {
- playlistIndex = index % playlist.numberOfItems;
- }
- return playlistIndex;
- }
-
- //nullable
- String audioPath({int at}) {
- if (at < playlist.audios.length) {
- return playlist.audios[at]?.path;
- } else {
- return null;
- }
- }
-
- String currentAudioPath() {
- return audioPath(at: playlistIndex);
- }
-
- bool hasNext() {
- return playlistIndex + 1 < playlist.numberOfItems;
- }
-
- _CurrentPlaylist({@required this.playlist});
-
- void returnToFirst() {
- playlistIndex = 0;
- }
-
- bool hasPrev() {
- return playlistIndex > 0;
- }
-
- void selectPrev() {
- playlistIndex--;
- if (playlistIndex < 0) {
- playlistIndex = 0;
- }
- }
-}
diff --git a/packages/flutter_assetsAudioPlayer/lib/playable.dart b/packages/flutter_assetsAudioPlayer/lib/playable.dart
deleted file mode 100644
index 459ff169..00000000
--- a/packages/flutter_assetsAudioPlayer/lib/playable.dart
+++ /dev/null
@@ -1,21 +0,0 @@
-import 'package:flutter/foundation.dart';
-
-class Playable {}
-
-@immutable
-class Audio implements Playable {
- final String path;
-
- const Audio(this.path);
-}
-
-@immutable
-class Playlist implements Playable {
- final List