B4A Library VitamioBundle

This library wraps the latest version of the VitamioBundle - that's currently version 4.2.0.
You can find more info on the VitamioBundle here:
https://github.com/yixia/VitamioBundle.

I'm not a user of this library, i just developed it for various other forum members.
So i'll post a basic code example and leave anyone that's interested to experiment for themselves to see what the library is capable of.

B4X:
#Region  Project Attributes 
   #ApplicationLabel: VitamioBundle4 example
   #VersionCode: 1
   #VersionName: 
   'SupportedOrientations possible values: unspecified, landscape or portrait.
   #SupportedOrientations: unspecified
   #CanInstallToExternalStorage: False
   #AdditionalRes: C:\Users\foobar\Basic4Android\VitamioBundle-4-2-0\library_files\res, io.vov.vitamio
#End Region
#Region  Activity Attributes 
   #FullScreen: True
   #IncludeTitle: True
#End Region
'Activity module
Sub Process_Globals
End Sub
Sub Globals
   Dim VitamioMediaController1 As Vitamio_MediaController
   Dim VitamioVideoView1 As Vitamio_VideoView
End Sub
Sub Activity_Create(FirstTime As Boolean)
   '   take a look at the manifest editor to see the additional entry activity required in order to use VitamioBundle
  
   '   VitamioBundle version 4.2.0 uses the new #AdditionalRes project attribute
   
   '   check if the VitamioBundle core is installed
   '   if this is the first time that the installed application has been started then the core will NOT be installed
   '   otherwise the core should be already installed
  
   '   if the core is NOT installed then CheckVitamioLibs returns False and this Activity's Finish method is called by the library
   '   the core is then installed and this Activity will be restarted
   '   CheckVitamioLibs will now return True and you can proceed to use the library
  
   If VitamioVideoView1.CheckVitamioLibs Then
  
     VitamioVideoView1.Initialize("VitamioVideoView1")
     Activity.AddView(VitamioVideoView1, 0, 0, 100%x, 100%y)
    
     VitamioMediaController1.Initialize("VitamioMediaController1")
    
     VitamioVideoView1.SetMediaController(VitamioMediaController1)
     VitamioVideoView1.SetVideoQuality(VitamioVideoView1.VIDEO_QUALITY_HIGH)
    
     VitamioVideoView1.SetVideoPath("http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8")
     '   VitamioVideoView1.SetVideoPath(File.Combine(File.DirRootExternal, "test_video.mp4"))
    
   End If
  
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
'   events raised by Vitamio_MediaController
Sub VitamioMediaController1_Hidden
   Log("VitamioMediaController1_Hidden")
End Sub
Sub VitamioMediaController1_Shown
   Log("VitamioMediaController1_Shown")
End Sub
'   events raised by Vitamio_VideoView
Sub VitamioVideoView1_BitmapSubtitleUpdated(Bitmap1() As Byte, Width As Int, Height As Int)
  
End Sub
Sub VitamioVideoView1_Buffering(Percent As Int)
   '   Log("VitamioVideoView1_Buffering: "&Percent)   '   commented out to avoid excess logging
End Sub
Sub VitamioVideoView1_Complete
   Log("VitamioVideoView1_Complete")
End Sub
Sub VitamioVideoView1_Error(MEDIA_ERROR As Int) As Boolean
   '   this event Sub must return a Boolean value to indicate whether it has handled the error or not
   '   returning True will prevent the library from taking any action such as displaying an error message
   Log("VitamioVideoView1_Error")
  
   Return True
End Sub
Sub VitamioVideoView1_Info(What As Int, Extra As Int) As Boolean
   '   what does this event mean?
   '   what do the Int parameters represent?
  
   '   Log("VitamioVideoView1_Info")   '   commented out to avoid excess logging
   Return False    '   indicates that this Sub has NOT handled the event and that the library should handle it
End Sub
Sub VitamioVideoView1_Prepared
   Log("VitamioVideoView1_Prepared")
End Sub
Sub VitamioVideoView1_SeekComplete
  
End Sub
Sub VitamioVideoView1_TextSubtitleUpdated(SubText As String)
  
End Sub

Previous versions of the VitamioBundle have already been posted (by myself) on this thread:
http://www.basic4ppc.com/android/forum/threads/video-view-fullscreen-and-on-top-on-ouya.31034/
The old links in that thread will no longer work - i've recently changed webhosts.

But the thread is full of useful info for anyone that's trying to use the VitamioBundle.
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.

The library is a 8.7MB download - far too big to attach to this post.
So the library is currently available from my webspace at:
http://b4a.martinpearman.co.uk/vitamiobundle/
You'll also find the b4a demo project at the same link.
(VitamioBundle-4-2-0-library-files.zip and VitamioBundle-4-2-0-demo.zip are the latest versions).

Martin.
 
Last edited:

andrewj

Active Member
Licensed User
Longtime User
Hi Martin,
I've just gone to update my app on Google Play Dev Console, and I'm getting a warning that Google have identified a security issue with versions of Vitamio lower than 5.0 and will block upload or publishing of any such apps after 14th March next. Are you aware of this, and if so is there any way you can upgrade the bundle appropriately?

I've just had a look at the Vitamio website, and the public download is V4.2.2. I'm guessing you have to register with them to get the latest version. I don't mind doing that if it would help (as long as they don't want lots of money), but if you are already in the process then it may not be necessary.

Please let me know what's the best way to proceed with this. If you'd prefer, PM me and we can progress by email.

Many thanks,
Andrew
 

warwound

Expert
Licensed User
Longtime User
@andrewj

My development of the VitamioBundle library stopped many months back.
Add to that the fact that i started a new job last month (and moved from the UK to Netherlands) and have very little free leisure time for programming.
I can make the library source code available if you or anyone else wants to try and update it, but can't offer much more help than that.

But from what you have posted it doesn't look like the required Vitamio version 5.0 is available as a free product - i'll leave you to do some research and find out if the version 5.0 is even available.
 

andrewj

Active Member
Licensed User
Longtime User
Hi Martin,

Thanks for the update. I fully appreciate that paid work comes first - that's why I've been fairly quiet for the last year or so.
In the first instance I'll investigate the licensing position, and then contact you directly if I need the source code.

Many thanks,

Andrew
 

Rick Harris

Well-Known Member
Licensed User
Longtime User
I have also run into the same problem. Martin, I hope you like your new job in The Netherlands. Welkom tot Amsterdam!
If you have some time to spare then please see if you can update your library to Vitamio version 5.0.
Thank you in advance. Like last time I can make a donation.
Prettige Kerstdagen en Gelukkig Nieuw Jaar!
 

warwound

Expert
Licensed User
Longtime User
@Rick Harris
I'm settling in and getting used to everything.
Flying back to the UK tomorrow and spending some time with my family and friends then returning to Amsterdam on 3rd January.
I've made a note on my calendar to look at VitamioBundle if or when i have time but can make no promises.
 

Rick Harris

Well-Known Member
Licensed User
Longtime User
@Rick Harris
I'm settling in and getting used to everything.
Flying back to the UK tomorrow and spending some time with my family and friends then returning to Amsterdam on 3rd January.
I've made a note on my calendar to look at VitamioBundle if or when i have time but can make no promises.
First of all: Happy New Year!
I hope you have found some time to take a look at Vitamio.
I am making a speaking subtitle app for visually impaired users. So far I can play the video and find / open the subtitle, and am now working on synchronizing the ".srt" file.
 
Last edited:

Leni Berry

Active Member
Licensed User
Dear Martin,
I have also run into the same problem. google said like this :

"
Hello Google Play Developer,

Your app(s) listed at the end of this email utilize a version of Vitamio, a multimedia library used for playing various types of media files, that contains a security vulnerability. If you have more than 20 affected apps in your account, please check the Developer Console for a full list.

Please upgrade your app(s) as soon as possible and increment the version number of the upgraded APK. Beginning March 14, 2016, Google Play will block publishing of new apps or updates that use pre-5.0 versions of Vitamio.

The vulnerability was addressed in Vitamio v5.0. The latest versions of the Vitamio SDK can be downloaded on the Vitamio website. You can confirm your Vitamio version by checking if the SDK includes libs/armeabi-v7a/libvinit.so or libs/armeabi/libvinit.so. If either file is present, the SDK needs to be upgraded. For help upgrading, see the Vitamio support documentation. You can also contact Vitamio support by emailingvitamio@yixia.com. If you’re using a 3rd party library that bundles Vitamio, you’ll need to upgrade it to a version that bundles Vitamio v5.0 or later.
"
Please Help.
 

warwound

Expert
Licensed User
Longtime User
On Jan 20th i let another forum member have a copy of the VitamioBundle source code and he was hoping to update it to the latest version so that this problem with Play Store would be resolved.
To date i've not heard anything back from that developer.
So i've sent a message and hopefully will hear back soon.
 

jazzzzzzz

Active Member
Licensed User
Longtime User
On Jan 20th i let another forum member have a copy of the VitamioBundle source code and he was hoping to update it to the latest version so that this problem with Play Store would be resolved.
To date i've not heard anything back from that developer.
So i've sent a message and hopefully will hear back soon.
Waiting....!
 

Leni Berry

Active Member
Licensed User
Hi martin,

would u like to send me also a copy of the VitamioBundle source code.
i will try to update it to the latest version...

best rgds,

Leni
 
Top