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.
Previous versions of the VitamioBundle have already been posted (by myself) on this thread:
http://www.b4x.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.
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.b4x.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: