After about a week...I thinks it's time to ask the SO community :)
Now I already have a working(work in progress) plugin that already does this.
java file that extends CordovaPlugin:
Intent objIntent = new Intent(cordovaObj.getActivity().getApplicationContext(), MY_SERVICE.class);
//pass the url to the service
objIntent.putExtra("mediaUrl", url);
//Start the service
cordovaObj.getActivity().getApplicationContext().startService(objIntent);
Then in the onCreate method of the service I instatiate androids native MediaPlayer class and onStartCommand() of the service I start the player. I also have a stop method as well. Once I got it working I wanted to try and exchange the andriod mediaplayer class with that of Vitamio.
I did the following https://github.com/yixia/VitamioBundle/wiki/Getting-Started
They had four easy instructions the 4th one being.. "Now you can use Vitamio Media API same as Android Media API"...??..um..no
Have all files in the right places and the manifes has proper declarations of activities and services but after compiling my app crashes on lauch.
Step 3 is my issue I can't call
if (!io.vov.vitamio.LibsChecker.checkVitamioLibs(this))
In an onCreate method in my service class I get and error. I tried placing this in my MainActivity's onCreate but got crash on start up
LAUNCH SUCCESS
E/AndroidRuntime(23282): java.lang.RuntimeException: Unable to start activity ComponentInfo{biz.urassociation.app/biz.urassociation.app.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CordovaInterfaceImpl.setActivityResultRequestCode(int)' on a null object reference
E/AndroidRuntime(23282): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CordovaInterfaceImpl.setActivityResultRequestCode(int)' on a null object reference
E/AndroidRuntime(23282): at org.apache.cordova.CordovaActivity.startActivityForResult(CordovaActivity.java:331)
The main issue is if use this in an activity won't I be forced to use an interface?
I just want to stream audio in the background while the user can navigate my app and use BroadcastReceiver intents to stop, pause, seekTo...etc from the plugin to the service or return position or player states.
Can anyone help??
Basically I want to use vitamio without a widow, widget, player interface etc I will controll this from cordova plugin. How can I use vitamio in such a way...any help would be great.
The Vitamio-Cor dova-Plugin works very well and plays HLS streams that don't normally work properly using native MediaPlayer...but I just want to play audio ...I commented out all the interface code but I still get an invisible window that prevents me from using my app until I tap the back button. I don't want to just use ndroid:theme="@android:style/Theme.NoDisplay" and modify the plugin the player should run as a service...that would be the proper way for an audio player anyway. Thanks again for the help I've really tried the best I can with what I know but at last I ask for your help.