Code Monkey home page Code Monkey logo

cordova-plugin-streaming's Introduction

cordova-plugin-streaming

This plugin provides an implementation of an Android service library which uses AAC Player. Ready to use Streaming Player Service. (Background Player Service).

Based in RadioPlayerService is the solution for long time Android HTML5 Audio implementation takes before playing a streaming.

Notifications

Nice notification to control the service when it's in running in the background

Supported Platforms

  • Android

Supported URLs

Installation

cordova plugin add cordova-plugin-streaming

Quick Example

...
onDeviceReady: function() {

  navigator.RADIO.initialize(function(s) {
    console.log('SUCCESS navigator.RADIO.initialize');
    if (s == 'STOPPED-FROM-NOTIFICATION') {
      // the reproduction was stopped from the notification
    } else if (s == 'STOPPED') {
      // the reproduction was stopped other than the notification
    }
  }, function(s) {
    console.log('ERROR navigator.RADIO.initialize');
  });

}
...


var url = 'http://hayatmix.net/;yayin.mp3.m3u';
navigator.RADIO.play(function(s) {
  console.log('SUCCESS navigator.RADIO.play');
}, function(s) {
  console.log('ERROR navigator.RADIO.play');
}, url, 'My Stream Title', 'My Stream Subtitle');


navigator.RADIO.stop(function(s) {
  console.log('SUCCESS navigator.RADIO.stop');
}, function(s) {
  console.log('ERROR navigator.RADIO.stop');
});

Libraries Used

AAC Decoder Library

Special thanks

Gonzalo Martinez for his great and continuos contributions

License

Copyright 2016 Martin Radosta.

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.

cordova-plugin-streaming's People

Contributors

mradosta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cordova-plugin-streaming's Issues

Play/Pause/Stop button not appear on notification bar.

I did a simple radio streaming player with this plugin and it works well but when I try to stop/pause the stream from notification bar it only show the X for close the notification, Play/Pause/Stop isn't showed.
img_20170127_175531

Thanks in advance!

RadioPlugin loading and not play

Sometime when i played stream, RADIO STATE change to LOADING... but not play. I must to remove app and reinstall. it's can play again. it happen when device is sleep.

Log
03-20 15:17:07.992 19602-19932/? E/RadioPlugin: RADIO STATE : LOADING...
03-20 15:18:07.998 19602-19932/? E/RadioPlugin: RADIO STATE : LOADING...

Error phonegap build this plugin

`Build Date: 2016-07-14 06:26:16 +0000

PLUGIN OUTPUT

Fetching plugin "cordova-plugin-whitelist@1" via npm
Installing "cordova-plugin-whitelist" at "1.2.2" for android

           This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

Fetching plugin "https://github.com/baricio/cordova-plugin-playstream.git" via git clone
Repository "https://github.com/baricio/cordova-plugin-playstream.git" checked out to git ref "master" at "49ba58b".
Installing "com.baricio.playstream" at "0.2.13" for android
Fetching plugin "https://github.com/apache/cordova-plugin-statusbar.git" via git clone
Repository "https://github.com/apache/cordova-plugin-statusbar.git" checked out to git ref "master" at "86cfafe".
Installing "cordova-plugin-statusbar" at "2.1.4-dev" for android
Fetching plugin "https://github.com/mradosta/cordova-plugin-streaming" via git clone
Repository "https://github.com/mradosta/cordova-plugin-streaming" checked out to git ref "master" at "df2992f".

Installing "cordova-plugin-streaming" at "1.4.0" for android

COMPILE OUTPUT

Executing: ant debug -f /project/build.xml
Buildfile: /project/build.xml
Buildfile: /project/build.xml

-check-env:
[checkenv] Android SDK Tools Revision 25.1.7

-setup:

-set-mode-check:

-set-debug-files:

-check-env:
[echo] Project Name: .RadioRadio
[checkenv] Android SDK Tools Revision 25.1.7

-setup:
[echo] Project Name: .RadioRadio
[gettype] Project Type: Application

-pre-clean:

clean:
[gettype] Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
[getlibpath] Library dependencies:
[getlibpath]
[getlibpath] ------------------
[getlibpath] Ordered libraries:
[getbuildtools] Using latest Build Tools: 23.0.1
[echo] Resolving Build Target for .RadioRadio...

nodeps:

-check-env:
[checkenv] Android SDK Tools Revision 25.1.7

-setup:
[echo] Project Name: .RadioRadio
[gettype] Project Type: Android Library

-pre-clean:

clean:

BUILD SUCCESSFUL
Total time: 1 second
[gettarget] Project Target: Android 5.1.1
[gettarget] API level: 22
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: /project/bin
[mkdir] Created dir: /project/bin/res
[mkdir] Created dir: /project/bin/rsObj
[mkdir] Created dir: /project/bin/rsLibs
[mkdir] Created dir: /project/gen
[mkdir] Created dir: /project/bin/classes
[mkdir] Created dir: /project/bin/dexedLibs
[echo] ----------
[echo] Resolving Dependencies for .RadioRadio...
[dependency] Library dependencies:
[dependency]
[dependency] ------------------
[dependency] Ordered libraries:
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...

nodeps:

-set-mode-check:

-set-debug-files:

-check-env:
[checkenv] Android SDK Tools Revision 25.1.7

-setup:
[echo] Project Name: .RadioRadio
[gettype] Project Type: Android Library

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
[getbuildtools] Using latest Build Tools: 23.0.1
[echo] Resolving Build Target for .RadioRadio...
[gettarget] Project Target: Android 5.1.1
[gettarget] API level: 22
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: /project/CordovaLib/res
[mkdir] Created dir: /project/CordovaLib/libs
[mkdir] Created dir: /project/CordovaLib/bin
[mkdir] Created dir: /project/CordovaLib/bin/res
[mkdir] Created dir: /project/CordovaLib/bin/rsObj
[mkdir] Created dir: /project/CordovaLib/bin/rsLibs
[mkdir] Created dir: /project/CordovaLib/gen
[mkdir] Created dir: /project/CordovaLib/bin/classes
[mkdir] Created dir: /project/CordovaLib/bin/dexedLibs
[echo] ----------
[echo] Resolving Dependencies for .RadioRadio...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------

-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:

-compile:
[javac] Compiling 36 source files to /project/CordovaLib/bin/classes
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[echo] Creating library output jar file...
[jar] Building jar: /project/CordovaLib/bin/classes.jar

-post-compile:

-obfuscate:

-dex:
[echo] Library project: do not convert bytecode...

-crunch:
[crunch] Crunching PNG Files in source dir: /project/CordovaLib/res
[crunch] To destination dir: /project/CordovaLib/bin/res
[crunch] Crunched 0 PNG files to update cache

-package-resources:
[echo] Library project: do not package resources...

-package:
[echo] Library project: do not package apk...

-post-package:

-do-debug:
[echo] Library project: do not create apk...
[propertyfile] Creating new property file: /project/CordovaLib/bin/build.prop
[propertyfile] Updating property file: /project/CordovaLib/bin/build.prop
[propertyfile] Updating property file: /project/CordovaLib/bin/build.prop
[propertyfile] Updating property file: /project/CordovaLib/bin/build.prop

-post-build:

debug:

-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:

-compile:
[javac] Compiling 13 source files to /project/bin/classes

-post-compile:

-obfuscate:

-dex:
[dex] input: /project/bin/classes
[dex] input: /project/CordovaLib/bin/classes.jar
[dex] input: /project/libs/armeabi.jar
[dex] input: /project/libs/aacdecoder.jar
[dex] input: /project/libs/libaacdecoder.jar
[dex] Pre-Dexing /project/CordovaLib/bin/classes.jar -> classes-50b78331796dd0ede65a83f743bd8262.jar
[dex] Pre-Dexing /project/libs/armeabi.jar -> armeabi-89e27aa47bd5aaa0ac0a7d9e72d8fb29.jar
[dex] Pre-Dexing /project/libs/aacdecoder.jar -> aacdecoder-40211830c4097550eb86fc033e812682.jar
[dex] Pre-Dexing /project/libs/libaacdecoder.jar -> libaacdecoder-7fa3f9077a4463dbeb99fdb698716536.jar
[dex] Converting compiled files and external libraries into /project/bin/classes.dex...
[dx] Merged dex A (34 defs/33.2KiB) with dex B (83 defs/103.9KiB). Result is 117 defs/161.5KiB. Took 0.2s
[dx]
[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
[dx] com.android.dex.DexException: Multiple dex files define Lcom/spoledge/aacdecoder/AACPlayer$1;Merged dex A (117 defs/161.5KiB) with dex B (15 defs/37.1KiB). Result is 132 defs/243.6KiB. Took 0.1s
[dx]
[dx] at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
[dx] at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
[dx] at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
[dx] at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
[dx] at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
[dx] at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
[dx] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
[dx] at com.android.dx.command.dexer.Main.run(Main.java:277)
[dx] at com.android.dx.command.dexer.Main.main(Main.java:245)
[dx] at com.android.dx.command.Main.main(Main.java:106)
[dx]

BUILD FAILED
/android-sdk/tools/ant/build.xml:888: The following error occurred while executing this line:
/android-sdk/tools/ant/build.xml:890: The following error occurred while executing this line:
/android-sdk/tools/ant/build.xml:902: The following error occurred while executing this line:
/android-sdk/tools/ant/build.xml:283: null returned: 2

Total time: 14 seconds

/project/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: ant with args: debug,-f,/project/build.xml`

Proxy not found

On click event i got this error message : Error: exec proxy not found for :: RadioPlugin :: play
Does anyone have same problem ?

Customize notification icon

Hi,

I'm using this plugin successfully. I'd like to know how can I set my own icon for status bar and a custom bitmap for expanded notification (instead of music note).

Thanks in advance.

Crash at startup Android when using API level 23

Cordova app for Android crashes at startup and won't start when using this plugin.

Here's the logcat from startup:

--------- beginning of crash
04-15 16:44:42.023 16034 16257 V RadioManager: RadioManagerLog : Requested to connect service.
04-15 16:44:42.374 16034 16034 E linker  : /data/app/nl.apptest-1/lib/arm/libaacdecoder.so: has text relocations
04-15 16:44:42.400 16034 16034 E AndroidRuntime: FATAL EXCEPTION: main
04-15 16:44:42.400 16034 16034 E AndroidRuntime: Process: nl.apptest, PID: 16034
04-15 16:44:42.400 16034 16034 E AndroidRuntime: Theme: themes:{default=overlay:system, iconPack:system, fontPkg:system, com.android.systemui=overlay:system, com.android.systemui.navbar=overlay:system}
04-15 16:44:42.400 16034 16034 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/nl.apptest-1/lib/arm/libaacdecoder.so: has text relocations
04-15 16:44:42.400 16034 16034 E AndroidRuntime:    at java.lang.Runtime.loadLibrary(Runtime.java:372)
04-15 16:44:42.400 16034 16034 E AndroidRuntime:    at java.lang.System.loadLibrary(System.java:1076)
04-15 16:44:42.400 16034 16034 E AndroidRuntime:    at com.spoledge.aacdecoder.Decoder.loadLibrary(Decoder.java:187)
04-15 16:44:42.400 16034 16034 E AndroidRuntime:    at com.spoledge.aacdecoder.Decoder.create(Decoder.java:221)
04-15 16:44:42.400 16034 16034 E AndroidRuntime:    at com.spoledge.aacdecoder.Decoder.create(Decoder.java:198)
04-15 16:44:42.400 16034 16034 E AndroidRuntime:    at com.spoledge.aacdecoder.AACPlayer.createDecoder(AACPlayer.java:508)
04-15 16:44:42.400 16034 16034 E AndroidRuntime:    at com.spoledge.aacdecoder.MultiPlayer.createDecoder(MultiPlayer.java:91)
04-15 16:44:42.400 16034 16034 E AndroidRuntime:    at com.spoledge.aacdecoder.AACPlayer.<init>(AACPlayer.java:130)
04-15 16:44:42.400 16034 16034 E AndroidRuntime:    at com.spoledge.aacdecoder.MultiPlayer.<init>(MultiPlayer.java:81)
04-15 16:44:42.400 16034 16034 E AndroidRuntime:    at com.imsd.radio.RadioPlayerService.getPlayer(RadioPlayerService.java:403)
04-15 16:44:42.400 16034 16034 E AndroidRuntime:    at com.imsd.radio.RadioPlayerService.onCreate(RadioPlayerService.java:215)
04-15 16:44:42.400 16034 16034 E AndroidRuntime:    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2911)
04-15 16:44:42.400 16034 16034 E AndroidRuntime:    at android.app.ActivityThread.-wrap4(ActivityThread.java)
04-15 16:44:42.400 16034 16034 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1446)
04-15 16:44:42.400 16034 16034 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:102)
04-15 16:44:42.400 16034 16034 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:148)
04-15 16:44:42.400 16034 16034 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:5461)
04-15 16:44:42.400 16034 16034 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
04-15 16:44:42.400 16034 16034 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
04-15 16:44:42.400 16034 16034 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Does someone know why? I think it has to do with API level 23 I'm using with this one, because on API level 22 it works fine.
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.