B4A Library VitamioBundle

hookshy

Well-Known Member
Licensed User
Longtime User
You'll read that the VitamioBundle is far from perfect and that it has a rather obscure licensing model that you as the developer will have to handle.

What is the difference from Standard edition and Supreme edition ... Since we use your lib how do we know which version do we use .
Free or not ? and in what conditions ?


Relevant specifications:
1. Everyone except individual needs to buy the Vitamio license, such as: government agency, education,institution, association, enterprise etc.
2. The Vitamio standard edition only limited to individual developers is free.
3.Android and IOS must be separate for authorization.
4.The followings do not belong to the "Standard version"service.

* Problems caused by modifying or using non-original Vitamio programme code;
* Database running errors or crash due to directly manipulate database;
* Faults caused by installing plugins;
* System faults caused by server, virtual machine;
* Re-development or customization
5. Effective Date: 2013.2.17--2014.12.31
 

hookshy

Well-Known Member
Licensed User
Longtime User
I did tested your library on various android versions and phones... I must say it is indeed an nice workout ..it loads very fast and support various media formats.

The sample app I did staring on your example crashes all the time on tablet with kitkat ...does anyone tested on this android version ?
(unfortunately I could not catch the error on logs )

Is is possible to run radio streaming with a process with this lib , I did try it though and did not succeded ?
 

aignatd

Member
Licensed User
Longtime User

aignatd

Member
Licensed User
Longtime User
Dear Martin,

In your b4a Wrapper I added :

public void SetAutoBitrate(boolean Auto) {
MediaPlayer pMediaPlayer;
pMediaPlayer.setAdaptiveStream(Auto);
}

But why there is an error ?

Thank you


Dear Martin,

I've managed todo the compile b4a wrapper and the name of b4a wrapper still the same "vitamio_bundle".
When I use this library at basic4android there are an error like the following :

ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code. 0.00
Generating R file. 0.12
Compiling generated Java code. Error
B4A line: 117
pVideo.AddView(ViVideoView, 0, 0, 100%x, 100%y)
javac 1.6.0_38-ea
src\sindo\mncplaymedia\com\main.java:409: cannot access io.vov.vitamio.widget.VideoView
class file for io.vov.vitamio.widget.VideoView not found
mostCurrent._pvideo.AddView((android.view.View)(mostCurrent._vv4.getObject()),(int) (0),(int) (0),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float) (100),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float) (100),mostCurrent.activityBA));

Thank you
 

warwound

Expert
Licensed User
Longtime User
Look at the attached screenshot.

You need to export a .jar file containing the src folders from both VitamioBundle-4.2.0 and VitamioBundle-4.2.0-B4A.
The export must also contain the lib folder from either project - the lib folder is identical in each project.

So expand the project tree for each project, select the 2 src folders and a lib folder then right click the selected folders and Export.

When you generate the javadoc/xml file you only need to generate javadoc/xml for the VitamioBundle-4.2.0-B4A src folder - do not include the VitamioBundle-4.2.0 src folder.
So select just the VitamioBundle-4.2.0-B4A src folder then select menu Project > Generate Javadoc.
 

Attachments

  • eclipse_vitamio.jpg
    64.7 KB · Views: 261

aignatd

Member
Licensed User
Longtime User


Dear Martin,

I've done what you said and there no more error.
Next, I add new function on b4a wrapper, like the following :

public MediaPlayer myMediaPlayer;

public void SetAutoBitrate(boolean adaptive) {
myMediaPlayer.setAdaptiveStream(adaptive);
}

then I create the .xml and .jar file (myVideoView.xml and myVideoView.jar)

When I use this library on my b4a project there an error, like the following :
java.lang.NullPointerException


Thank you.

(Sorry, I was just learning java programming)
 

warwound

Expert
Licensed User
Longtime User
You've created a property myMediaPlayer but not set it's value to anything - it is null.

The class io.vov.vitamio.widget.VideoView has a private property named mMediaPlayer which is the instance of the MediaPlayer that you require.
But mMediaPlayer is private and has no getter method - you cannot access it.

Try this:

  • Open the class io.vov.vitamio.widget.VideoView
  • Create a new method:
    B4X:
    public MediaPlayer getMediaPlayer(){
    	return mMediaPlayer;
    }
    You can place this new method anywhere in the class - i'd suggest before the getMetaEncoding() method to keep things sorted alphabetically.
    Here's the new method inserted between the existing isBuffering() and getMetaEncoding() methods:
    B4X:
    public boolean isBuffering() {
    	if (mMediaPlayer != null)
    		return mMediaPlayer.isBuffering();
    	return false;
    }
    
    public MediaPlayer getMediaPlayer(){
    	return mMediaPlayer;
    }
    
    public String getMetaEncoding() {
    	if (mMediaPlayer != null)
    		return mMediaPlayer.getMetaEncoding();
    	return null;
    }
  • Open the wrapper class uk.co.martinpearman.b4a.vitamio.widget
  • Remove your line that creates the myMediaPlayer property:
    B4X:
    public MediaPlayer myMediaPlayer; // delete this line
  • Create your new method, you can now access the MediaPlayer instance using the syntax getObject().getMediaPlayer():
    B4X:
    public void SetAdaptiveStream(boolean Adaptive){
    	getObject().getMediaPlayer().setAdaptiveStream(Adaptive);
    }

Now recompile and test...
 

salvadoro

Member
Licensed User
Longtime User

Hi Johnmcenroy,

Thanks for the ex. for resize the view, but how do you catch the error event, when i use xmlLayout can't catch this, only catch if dont use it.

Salvador.
 

aignatd

Member
Licensed User
Longtime User


Dear Martin,

I've done your instructions like the following :



But the error still the same "java.lang.NullPointerException" (compiling b4a wrapper not showing an error).
if I see the statement "mMediaPlayer = new MediaPlayer(mContext, false)" this statement only running when I call "openvideo".

What is your suggestion ??

Thank you
 

Attachments

  • upload_2015-1-23_15-22-28.png
    171.4 KB · Views: 240
  • upload_2015-1-23_15-22-42.png
    171.4 KB · Views: 241
  • upload_2015-1-23_15-25-45.png
    178.7 KB · Views: 239

warwound

Expert
Licensed User
Longtime User
if I see the statement "mMediaPlayer = new MediaPlayer(mContext, false)" this statement only running when I call "openvideo".

What is your suggestion ??

So the instance of MediaPlayer is only created after 'openvideo' is called - so you can only call SetAdaptiveStream after calling 'openvideo'.
There's no working around that .
 

aignatd

Member
Licensed User
Longtime User
So the instance of MediaPlayer is only created after 'openvideo' is called - so you can only call SetAdaptiveStream after calling 'openvideo'.
There's no working around that .

Dear Martin,

If I call your statement "GetMetaEncoding", I get the same error "java.lang.NullPointerException"
If i call after "openvideo" there no use, still error


Thank you





































































































































































GetMetaEncoding
 

warwound

Expert
Licensed User
Longtime User
Can you post a copy of the log that shows the error - a copy that shows line numbers in the java classes where the exception occurs?
 

scsjc

Well-Known Member
Licensed User
Longtime User
Hello,
is possible KillBackgroundProcesses("vitaminobundle") ??????
i try:

B4X:
    Dim m As ActivityManager
    m.KillBackgroundProcesses("io.vov.vitamio")

but don't work
because, i lost control from activity when the user (kill all activities) and the vitaminobundle continue working...
 

Asim A Baki

Active Member
Licensed User
Longtime User
is there anyway someone can build the current VitamioBundle-4.2.0-B4A wit the function
setFormat wrapped so we can use it with PixelFormat.RGBX_8888

Some people like me know nothing about using Eclipse, this is why I use B4A

Thanks
 

Asim A Baki

Active Member
Licensed User
Longtime User
is there anyway someone can build the current VitamioBundle-4.2.0-B4A wit the function
setFormat wrapped so we can use it with PixelFormat.RGBX_8888

Some people like me know nothing about using Eclipse, this is why I use B4A

Thanks

[SOLVED]
After some digging, I found a simple solution, setVideoChroma(0) in the initialization as the code below that fixed the pixelated picture issue

B4X:
    VitamioVideoView1.Initialize("VitamioVideoView1")
   
    If VitamioVideoView1.CheckVitamioLibs Then
   

        Activity.AddView(VitamioVideoView1, 0,0,100%x,100%y)
       
        'VitamioMediaController1.Initialize("VitamioMediaController1")
        VitamioVideoView1.SetVideoChroma(0)
        VitamioVideoView1.SetBufferSize (20000)
        VitamioVideoView1.SetVideoQuality(VitamioVideoView1.VIDEO_QUALITY_MEDIUM )

    End If

I hope this could save sombody's time
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…