vv.MediaControllerEnabled=False
Activity.AddView(Panel3, 0dip, 0dip, Activity.width, Activity.height)
Panel3.AddView(vv, 0dip, 0dip, Panel3.width, Panel3.height)
vv.LoadVideo("http", "videofile location")
vv.Play
Activity.AddView(Panel2, 400dip, 400dip, 60dip, 60dip)
Panel2.AddView(ImageView3, 0dip, 0dip, 60dip, 60dip)
ImageView3.Bitmap = LoadBitmap(File.DirAssets, "ouya_o.png")
ImageView3.Gravity=Gravity.fill
Panel2.BringToFront
ImageView3.BringToFront
Activity.AddView(Panel3, 0dip, 0dip,100dip, 100dip)
Panel3.AddView(vv, 0dip, 0dip, Panel3.width, Panel3.height)
If I use the same code with the vitamob4a library, it allows me to have the video in a panel and have an overlay, but it only crops the video not scales to fit (not a huge issue as fullscreen is not so much of an problem for me now), and as I said before, I would prefer not for users to have to download something else for it to work.
Have you tried to enable the MediaController?
Brilliant, thanks for that, will report back with my progressI'll send you a PM with a link to a newer b4a Vitamio library.
This newer version is self contained - no need for your app users to visit the Play Store and download the additional Vitamio plugin.
Martin.
Warwound
Would it be possible to upload the new version of the self contained Viatmio library ?
I and I am sure others would be greatful
Thanks in advance.
#Region Module Attributes
#FullScreen: True
#IncludeTitle: False
#ApplicationLabel: VitamioBundle demo
#VersionCode: 1
#VersionName:
#SupportedOrientations: landscape
#CanInstallToExternalStorage: False
#End Region
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
Dim VitamioMediaController1 As VitamioMediaController
Dim VitamioVideoView1 As VitamioVideoView
Dim VV As VideoView
Dim VitOn As Int
Dim Overlay As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
' 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, 5%x, 5%y, 90%x, 90%y)
VitamioMediaController1.Initialize("VitamioMediaController1")
VitamioVideoView1.SetMediaController(VitamioMediaController1)
VitamioVideoView1.SetVideoPath("http://r7---sn-cn3tc-ac5l.c.youtube.com/videoplayback?sver=3&expire=1374248116&itag=22&id=ad4b57f29165e967&upn=8gOITPaVVjM&cp=U0hWSVJPVl9GUENONl9KSVpCOjlpS3VzYjhtbHBt&sparams=cp,id,ip,ipbits,itag,ratebypass,source,upn,expire&mt=1374226349&mv=m&source=youtube&ms=au&ratebypass=yes&ipbits=8&fexp=916904,912506,919359,929204,929117,929121,929906,929907,929127,929129,929131,925720,925722,925718,925714,929917,929919,912521,904830,919373,904122,908534,936303,909549,900816,912711,935000,921057,929309&key=yt1&ip=90.210.142.0&signature=D73749669A867FA322383BFFA084F2146BEBE582.D1B502EC0FD3764F00A323507AF01274B5109A21")
VitamioVideoView1.SetVideoQuality(VitamioVideoView1.VIDEO_QUALITY_HIGH)
End If
VitOn=1
Overlay.Initialize("overlay")
Activity.AddView(Overlay, 50dip, 50dip, 40dip, 40dip)
Overlay.Color = Colors.ARGB (100, 200, 200, 200)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
If VitamioVideoView1.IsPlaying Then
VitamioVideoView1.StopPlayback
End If
End Sub
Sub VitamioVideoView1_Buffering(Percent As Int)
' Log("VitamioVideoView1_Buffering: "&Percent) ' commented out to avoid unless 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 unless 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 Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event
If KeyCode = KeyCodes.KEYCODE_MENU Then
If VitOn=1 Then
VitamioVideoView1.StopPlayback
VitamioVideoView1.RemoveView
VV.Initialize("vv")
Activity.AddView(VV, 5%x, 5%y, 90%x, 90%y)
VV.LoadVideo("http", "http://r7---sn-cn3tc-ac5l.c.youtube.com/videoplayback?sver=3&expire=1374248116&itag=22&id=ad4b57f29165e967&upn=8gOITPaVVjM&cp=U0hWSVJPVl9GUENONl9KSVpCOjlpS3VzYjhtbHBt&sparams=cp,id,ip,ipbits,itag,ratebypass,source,upn,expire&mt=1374226349&mv=m&source=youtube&ms=au&ratebypass=yes&ipbits=8&fexp=916904,912506,919359,929204,929117,929121,929906,929907,929127,929129,929131,925720,925722,925718,925714,929917,929919,912521,904830,919373,904122,908534,936303,909549,900816,912711,935000,921057,929309&key=yt1&ip=90.210.142.0&signature=D73749669A867FA322383BFFA084F2146BEBE582.D1B502EC0FD3764F00A323507AF01274B5109A21")
VV.play
VitOn=2
Else
VV.Stop
VV.RemoveView
If VitamioVideoView1.CheckVitamioLibs Then
VitamioVideoView1.Initialize("VitamioVideoView1")
Activity.AddView(VitamioVideoView1, 5%x, 5%y, 90%x, 90%y)
VitamioMediaController1.Initialize("VitamioMediaController1")
VitamioVideoView1.SetMediaController(VitamioMediaController1)
VitamioVideoView1.SetVideoPath("http://r7---sn-cn3tc-ac5l.c.youtube.com/videoplayback?sver=3&expire=1374248116&itag=22&id=ad4b57f29165e967&upn=8gOITPaVVjM&cp=U0hWSVJPVl9GUENONl9KSVpCOjlpS3VzYjhtbHBt&sparams=cp,id,ip,ipbits,itag,ratebypass,source,upn,expire&mt=1374226349&mv=m&source=youtube&ms=au&ratebypass=yes&ipbits=8&fexp=916904,912506,919359,929204,929117,929121,929906,929907,929127,929129,929131,925720,925722,925718,925714,929917,929919,912521,904830,919373,904122,908534,936303,909549,900816,912711,935000,921057,929309&key=yt1&ip=90.210.142.0&signature=D73749669A867FA322383BFFA084F2146BEBE582.D1B502EC0FD3764F00A323507AF01274B5109A21")
VitamioVideoView1.SetVideoQuality(VitamioVideoView1.VIDEO_QUALITY_HIGH)
VitOn=1
End If
End If
End If
End Sub
http://r7---sn-cn3tc-ac5l.c.youtube.com/videoplayback?sparams=cp,id,ip,ipbits,itag,ratebypass,source,upn,expire&id=ad4b57f29165e967&key=yt1&cp=U0hWSVNLU19GUENONl9LRVdIOjlpS3VzYzRqcnBt&upn=UUHy5OPmdvA&ms=au&fexp=916904,912506,919359,929204,929117,929121,929906,929907,929127,929129,929131,925720,925722,925718,925714,929917,929919,912521,931917,904830,919373,904122,908534,919387,936303,909549,900816,936301,912711,935000,921057,929309&source=youtube&sver=3&itag=22&ratebypass=yes&mv=m&expire=1374305716&ip=90.212.81.34&mt=1374284048&ipbits=8&signature=4FCFED9B80DD3FC948C558D52D21C4321B4FD908.8A74C392E557C3E0A263E780C84DBEFAF51E8002
#Region Module Attributes
#FullScreen: True
#IncludeTitle: False
#ApplicationLabel: VitamioBundle demo
#VersionCode: 1
#VersionName:
#SupportedOrientations: landscape
#CanInstallToExternalStorage: False
#End Region
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
Dim VitamioMediaController1 As VitamioMediaController
Dim VitamioVideoView1 As VitamioVideoView
Dim VV As VideoView
Dim VitOn As Int
Dim Overlay As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
' 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, 5%x, 5%y, 90%x, 90%y)
VitamioMediaController1.Initialize("VitamioMediaController1")
VitamioVideoView1.SetMediaController(VitamioMediaController1)
VitamioVideoView1.SetVideoPath("http://www.auby.no/files/video_tests/h264_720p_mp_3.1_3mbps_aac_shrinkage.mp4")
VitamioVideoView1.SetVideoQuality(VitamioVideoView1.VIDEO_QUALITY_HIGH)
End If
VitOn=1
Overlay.Initialize("overlay")
Activity.AddView(Overlay, 50dip, 50dip, 40dip, 40dip)
Overlay.Color = Colors.ARGB (100, 200, 200, 200)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
If VitamioVideoView1.IsPlaying Then
VitamioVideoView1.StopPlayback
End If
End Sub
Sub VitamioVideoView1_Buffering(Percent As Int)
' Log("VitamioVideoView1_Buffering: "&Percent) ' commented out to avoid unless 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 unless 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 Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event
If KeyCode = KeyCodes.KEYCODE_MENU Then
If VitOn=1 Then
VitamioVideoView1.StopPlayback
VitamioVideoView1.RemoveView
VV.Initialize("vv")
Activity.AddView(VV, 5%x, 5%y, 90%x, 90%y)
VV.LoadVideo("http", "http://www.auby.no/files/video_tests/h264_720p_mp_3.1_3mbps_aac_shrinkage.mp4")
VV.play
VitOn=2
Else
VV.Stop
VV.RemoveView
If VitamioVideoView1.CheckVitamioLibs Then
VitamioVideoView1.Initialize("VitamioVideoView1")
Activity.AddView(VitamioVideoView1, 5%x, 5%y, 90%x, 90%y)
VitamioMediaController1.Initialize("VitamioMediaController1")
VitamioVideoView1.SetMediaController(VitamioMediaController1)
VitamioVideoView1.SetVideoPath("http://www.auby.no/files/video_tests/h264_720p_mp_3.1_3mbps_aac_shrinkage.mp4")
VitamioVideoView1.SetVideoQuality(VitamioVideoView1.VIDEO_QUALITY_HIGH)
VitOn=1
End If
End If
End If
End Sub
As far as I know, there is nothing you as a developer can change to improve the quality unless version 4 has something new to offer (maybe hardware-decoding). I recall no other APIs to wrap.
You have 3 options: 16 (High), 0 (medium) or -16 (low)
You can use vv.SetVideoQuality(16) as well
Try to toggle between qualities once the file is being shown (start high, then medium, then low and then back to high. I have noted that sometimes the vitamio-library improves quality after a while (maybe a buffering issue) although I have only tested with streaming.
VitamioVideoView1.SetVideoQuality(VitamioVideoView1.VIDEO_QUALITY_HIGH)
Does the Vitamio library allow quality changes during playback?
Dim action As AHActionItem
action = ac2.getActionItem(Position)
DoEvents
If action.ActionId = 1 Then
vv.setVideoQuality(16) 'High
ToastMessageShow("Video Quality is now High.", False)
Else If action.ActionId = 2 Then
vv.setVideoQuality(0) 'Medium
ToastMessageShow("Video Quality is now Medium.", False)
Else If action.ActionId = 3 Then
vv.setVideoQuality( - 16) 'Low
ToastMessageShow("Video Quality is now Low.", False)
End If
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?