Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ExoPlayer instead of AACdecoder for android #44

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8c6711e
WIP Replace aacdecoder with ExoPlayer
Aug 14, 2016
64d3fd6
Upgrade exoplayer
Nov 18, 2016
f75d26e
Fix user agent and try ID3 metadata parsing
Nov 18, 2016
0f26d6a
Adding duration and progress to status object returned by getStatus()
cherniv Apr 21, 2017
8323aeb
Replacing AudioStreamingDataSourceFactory with DefaultDataSourceFactory
cherniv Apr 21, 2017
ac2be83
catching ended/stopped event
cherniv Apr 21, 2017
414b0ee
Android notification content and layout fixes
cherniv Apr 23, 2017
1db8ebf
Android notification layout fix
cherniv Apr 23, 2017
1c16cea
Android seekTo fix
cherniv Apr 24, 2017
be6082b
ios - jump 30 seconds back/forward in NowPlayingCenter
cherniv Apr 29, 2017
c3a31db
ios progress bar in NowPlayingCenter
cherniv Apr 30, 2017
c4e1675
fixing indentation
cherniv May 19, 2017
14f0231
fixing indentation
cherniv May 19, 2017
ac8c9b5
prevent crashing when getCurrentActivity() returns null
cherniv Jun 13, 2017
c4230a4
on android getStatus() should return current media url
cherniv Jun 13, 2017
39f9162
preventing crash when player is null
cherniv Jun 13, 2017
df3cad5
get activity before showing notification
cherniv Jun 13, 2017
55980aa
Remove createJSModules @overide marker - RN 0.47 compatibility
cherniv Aug 27, 2017
2e0c33f
upgrading ExoPlayer to version 2.4
cherniv Aug 27, 2017
917b24c
adding playback speed controlling functionality
cherniv Aug 27, 2017
9f43200
PropTypes is not a part of React anymore
cherniv Sep 26, 2017
5f2926a
Merge pull request #88 from cherniv/android-exoplayer
tlenclos Oct 1, 2017
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: 1 addition & 1 deletion Example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"dependencies": {
"react": "15.2.1",
"react": "15.3.2",
"react-native": "0.37.0",
"react-native-audio-streaming": "file:../"
}
Expand Down
135 changes: 26 additions & 109 deletions Example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ babel-code-frame@^6.16.0:
esutils "^2.0.2"
js-tokens "^2.0.0"

babel-core@^6.10.4, babel-core@^6.17.0, babel-core@^6.18.0, babel-core@^6.7.2:
babel-core@^6.17.0, babel-core@^6.18.0, babel-core@^6.7.2:
version "6.18.2"
resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.18.2.tgz#d8bb14dd6986fa4f3566a26ceda3964fa0e04e5b"
dependencies:
Expand Down Expand Up @@ -468,7 +468,7 @@ babel-plugin-transform-es3-property-literals@^6.5.0, babel-plugin-transform-es3-
dependencies:
babel-runtime "^6.0.0"

babel-plugin-transform-flow-strip-types@^6.14.0, babel-plugin-transform-flow-strip-types@^6.5.0, babel-plugin-transform-flow-strip-types@^6.6.5, babel-plugin-transform-flow-strip-types@^6.7.0, babel-plugin-transform-flow-strip-types@^6.8.0:
babel-plugin-transform-flow-strip-types@^6.14.0, babel-plugin-transform-flow-strip-types@^6.5.0, babel-plugin-transform-flow-strip-types@^6.7.0, babel-plugin-transform-flow-strip-types@^6.8.0:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.18.0.tgz#4d3e642158661e9b40db457c004a30817fa32592"
dependencies:
Expand Down Expand Up @@ -524,15 +524,15 @@ babel-plugin-transform-strict-mode@^6.18.0:
babel-runtime "^6.0.0"
babel-types "^6.18.0"

babel-polyfill@^6.16.0, babel-polyfill@^6.9.1:
babel-polyfill@^6.16.0:
version "6.16.0"
resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.16.0.tgz#2d45021df87e26a374b6d4d1a9c65964d17f2422"
dependencies:
babel-runtime "^6.9.1"
core-js "^2.4.0"
regenerator-runtime "^0.9.5"

babel-preset-es2015-node@^6.1.0, babel-preset-es2015-node@^6.1.1:
babel-preset-es2015-node@^6.1.1:
version "6.1.1"
resolved "https://registry.yarnpkg.com/babel-preset-es2015-node/-/babel-preset-es2015-node-6.1.1.tgz#60b23157024b0cfebf3a63554cb05ee035b4e55f"
dependencies:
Expand Down Expand Up @@ -575,7 +575,7 @@ babel-preset-fbjs@^1.0.0:
babel-plugin-transform-object-rest-spread "^6.6.5"
object-assign "^4.0.1"

babel-preset-fbjs@^2.0.0, babel-preset-fbjs@^2.1.0:
babel-preset-fbjs@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/babel-preset-fbjs/-/babel-preset-fbjs-2.1.0.tgz#1a8d4cacbac7c5a9194ce3b8475ffab33ed524fb"
dependencies:
Expand Down Expand Up @@ -642,7 +642,7 @@ babel-preset-react-native@^1.9.0:
babel-plugin-transform-regenerator "^6.5.0"
react-transform-hmr "^1.0.4"

babel-register@^6.16.3, babel-register@^6.18.0, babel-register@^6.6.0:
babel-register@^6.16.3, babel-register@^6.18.0:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.18.0.tgz#892e2e03865078dd90ad2c715111ec4449b32a68"
dependencies:
Expand Down Expand Up @@ -685,7 +685,7 @@ babel-traverse@^6.16.0, babel-traverse@^6.18.0:
invariant "^2.2.0"
lodash "^4.2.0"

babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.6.4, babel-types@^6.8.0, babel-types@^6.9.0:
babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.8.0, babel-types@^6.9.0:
version "6.19.0"
resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.19.0.tgz#8db2972dbed01f1192a8b602ba1e1e4c516240b9"
dependencies:
Expand All @@ -694,9 +694,9 @@ babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.6.
lodash "^4.2.0"
to-fast-properties "^1.0.1"

babylon@^6.11.0, babylon@^6.13.0, babylon@^6.8.2:
version "6.14.0"
resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.14.0.tgz#c8ba4b69b544b2cd8f3fb96b06614660a49b7128"
babylon@^6.11.0, babylon@^6.13.0:
version "6.14.1"
resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.14.1.tgz#956275fab72753ad9b3435d7afe58f8bf0a29815"

balanced-match@^0.4.1:
version "0.4.2"
Expand All @@ -706,14 +706,14 @@ base62@^1.1.0:
version "1.1.2"
resolved "https://registry.yarnpkg.com/base62/-/base62-1.1.2.tgz#22ced6a49913565bc0b8d9a11563a465c084124c"

base64-js@^0.0.8, [email protected]:
version "0.0.8"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-0.0.8.tgz#1101e9544f4a76b1bc3b26d452ca96d7a35e7978"

base64-js@^1.1.2:
version "1.2.0"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.0.tgz#a39992d723584811982be5e290bb6a53d86700f1"

[email protected]:
version "0.0.8"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-0.0.8.tgz#1101e9544f4a76b1bc3b26d452ca96d7a35e7978"

[email protected]:
version "1.2.1"
resolved "https://registry.yarnpkg.com/base64-url/-/base64-url-1.2.1.tgz#199fd661702a0e7b7dcae6e0698bb089c52f6d78"
Expand Down Expand Up @@ -1590,7 +1590,7 @@ fbjs-scripts@^0.7.0:
semver "^5.1.0"
through2 "^2.0.0"

fbjs@^0.8.1, fbjs@^0.8.3:
fbjs@^0.8.3, fbjs@^0.8.4:
version "0.8.6"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.6.tgz#7eb67d6986b2d5007a9b6e92e0e7cb6f75cad290"
dependencies:
Expand Down Expand Up @@ -2732,17 +2732,6 @@ node-fetch@^1.0.1, node-fetch@^1.3.3:
encoding "^0.1.11"
is-stream "^1.0.1"

node-haste@~2.12.0:
version "2.12.0"
resolved "https://registry.yarnpkg.com/node-haste/-/node-haste-2.12.0.tgz#8d4d1cb87f05adcc4207525b789d7dc717f3c1d7"
dependencies:
absolute-path "^0.0.0"
debug "^2.2.0"
denodeify "^1.2.1"
graceful-fs "^4.1.3"
json-stable-stringify "^1.0.1"
sane "^1.3.1"

node-int64@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b"
Expand Down Expand Up @@ -3077,7 +3066,7 @@ react-deep-force-update@^1.0.0:
"react-native-audio-streaming@file:../":
version "2.2.0"

react-native@^0.37.0:
[email protected]:
version "0.37.0"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.37.0.tgz#d871c752b4d87e46b569fd8be2921d4f9248c87d"
dependencies:
Expand Down Expand Up @@ -3154,78 +3143,6 @@ react-native@^0.37.0:
yeoman-environment "1.5.3"
yeoman-generator "0.21.2"

[email protected]:
version "0.31.0"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.31.0.tgz#ae37068414b75855c718e465acf70d473e47bccb"
dependencies:
absolute-path "^0.0.0"
art "^0.10.0"
babel-core "^6.10.4"
babel-plugin-external-helpers "^6.8.0"
babel-plugin-syntax-trailing-function-commas "^6.5.0"
babel-plugin-transform-flow-strip-types "^6.6.5"
babel-plugin-transform-object-rest-spread "^6.6.5"
babel-polyfill "^6.9.1"
babel-preset-es2015-node "^6.1.0"
babel-preset-fbjs "^2.0.0"
babel-preset-react-native "^1.9.0"
babel-register "^6.6.0"
babel-types "^6.6.4"
babylon "^6.8.2"
base64-js "^0.0.8"
bser "^1.0.2"
chalk "^1.1.1"
commander "^2.9.0"
connect "^2.8.3"
core-js "^2.2.2"
debug "^2.2.0"
event-target-shim "^1.0.5"
fbjs "^0.8.3"
fbjs-scripts "^0.7.0"
fs-extra "^0.26.2"
glob "^5.0.15"
graceful-fs "^4.1.3"
image-size "^0.3.5"
immutable "~3.7.6"
inquirer "^0.12.0"
joi "^6.6.1"
json-stable-stringify "^1.0.1"
json5 "^0.4.0"
jstransform "^11.0.3"
lodash "^3.10.1"
mime "^1.3.4"
mime-types "2.1.11"
mkdirp "^0.5.1"
module-deps "^3.9.1"
node-fetch "^1.3.3"
node-haste "~2.12.0"
npmlog "^2.0.4"
opn "^3.0.2"
optimist "^0.6.1"
plist "^1.2.0"
progress "^1.1.8"
promise "^7.1.1"
react-clone-referenced-element "^1.0.1"
react-timer-mixin "^0.13.2"
react-transform-hmr "^1.0.4"
rebound "^0.0.13"
regenerator-runtime "^0.9.5"
sane "^1.2.0"
semver "^5.0.3"
source-map "^0.4.4"
stacktrace-parser "^0.1.3"
temp "0.8.3"
uglify-js "^2.6.2"
whatwg-fetch "^1.0.0"
wordwrap "^1.0.0"
worker-farm "^1.3.1"
ws "^1.1.0"
xcode "^0.8.9"
xmldoc "^0.4.0"
yargs "^3.24.0"
yeoman-environment "1.5.3"
yeoman-generator "0.21.2"

react-proxy@^1.1.7:
version "1.1.8"
resolved "https://registry.yarnpkg.com/react-proxy/-/react-proxy-1.1.8.tgz#9dbfd9d927528c3aa9f444e4558c37830ab8c26a"
Expand All @@ -3244,11 +3161,11 @@ react-transform-hmr@^1.0.4:
global "^4.3.0"
react-proxy "^1.1.7"

react@15.2.1:
version "15.2.1"
resolved "https://registry.yarnpkg.com/react/-/react-15.2.1.tgz#e458df700bae72900ba32673b7e42e8dbd05a393"
react@15.3.2:
version "15.3.2"
resolved "https://registry.yarnpkg.com/react/-/react-15.3.2.tgz#a7bccd2fee8af126b0317e222c28d1d54528d09e"
dependencies:
fbjs "^0.8.1"
fbjs "^0.8.4"
loose-envify "^1.1.0"
object-assign "^4.1.0"

Expand Down Expand Up @@ -3463,7 +3380,7 @@ [email protected]:
version "1.1.2"
resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.1.2.tgz#bec11fdc83a9fda063401210e40176c3024d1567"

sane@^1.2.0, sane@^1.3.1, sane@~1.4.1:
sane@~1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/sane/-/sane-1.4.1.tgz#88f763d74040f5f0c256b6163db399bf110ac715"
dependencies:
Expand Down Expand Up @@ -3573,7 +3490,7 @@ source-map-support@^0.4.2:
dependencies:
source-map "^0.5.3"

source-map@^0.4.2, source-map@^0.4.4:
source-map@^0.4.2:
version "0.4.4"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b"
dependencies:
Expand Down Expand Up @@ -4072,12 +3989,12 @@ watch@~0.10.0:
resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc"

whatwg-fetch@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-1.1.0.tgz#f143957839af3b6fbfbb00f70eb752292fe1cbb6"
version "1.1.1"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-1.1.1.tgz#ac3c9d39f320c6dce5339969d054ef43dd333319"

whatwg-fetch@>=0.10.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.0.tgz#cde428ac2b1dab717c96bc6785feb557619b249e"
version "2.0.1"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.1.tgz#078b9461bbe91cea73cbce8bb122a05f9e92b772"

which@^1.2.8, which@^1.2.9:
version "1.2.12"
Expand Down
8 changes: 4 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
compileSdkVersion 25
buildToolsVersion "25.0.1"

defaultConfig {
minSdkVersion 16
targetSdkVersion 22
targetSdkVersion 25
versionCode 1
versionName "1.0"
ndk {
Expand All @@ -21,6 +21,6 @@ android {

dependencies {
compile 'com.facebook.react:react-native:0.20.+'
compile files('libs/aacdecoder-android-0.8.jar')
compile 'com.google.android.exoplayer:exoplayer:r2.4.2'
}

7 changes: 5 additions & 2 deletions android/src/main/java/com/audioStreaming/Mode.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
public class Mode {
public static String CREATED = "CREATED";
public static String CONNECTING = "CONNECTING";
public static String START_PREPARING = "START_PREPARING";
public static String PREPARED = "PREPARED";
public static String PREPARING = "PREPARING";
public static String READY = "READY";
public static String STARTED = "STARTED";
public static String PLAYING = "PLAYING";
public static String STOPPED = "STOPPED";
public static String PAUSED = "PAUSED";
public static String RESUMED = "RESUMED";
public static String COMPLETED = "COMPLETED";
public static String ERROR = "ERROR";
public static String BUFFERING_START = "BUFFERING_START";
public static String BUFFERING_END = "BUFFERING_END";
public static String METADATA_UPDATED = "METADATA_UPDATED";
public static String ALBUM_UPDATED = "ALBUM_UPDATED";
public static String DESTROYED = "DESTROYED";
public static String IDLE = "IDLE";
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void onCallStateChanged(int state, String incomingNumber) {
break;
case TelephonyManager.CALL_STATE_RINGING:
//CALL_STATE_RINGING
if (this.module.getSignal().isPlaying) {
if (this.module.getSignal().isPlaying()) {
this.module.stopOncall();
}
break;
Expand Down
Loading