Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim vv_sopra_pannello As VideoViewExt
Dim Panel_Wait As Panel
Dim immagine_pannello As ImageView
Dim w,h As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
......
File.Copy(File.DirAssets, "vid_bokeh.mp4", File.DirInternal, "vid_bokeh.mp4")
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("lay_partenza")
'Wait that download...
vv_sopra_pannello.Initialize("vv_sopra_pannello")
vv_sopra_pannello.LoadVideo(File.DirInternal, "vid_bokeh.mp4")
'Calculation Proportion Movie
Dim vidfile, Dir, VideoName As String
Dir = File.DirInternal
VideoName = "vid_bokeh.mp4"
vidfile = File.Combine(Dir, VideoName)
Dim rfl As Reflector
Dim obj As Object
Dim b As Bitmap
obj = rfl.CreateObject("android.media.MediaMetadataRetriever")
rfl.Target = obj
rfl.RunMethod2("setDataSource", vidfile, "java.lang.String")
b = rfl.RunMethod3("getFrameAtTime", 0, "java.lang.long", 3, "java.lang.int")
Dim new_width, new_height As Int
If ( b.Width / b.Height < Activity.Width / Activity.Height ) Then 'Landscape
new_width = Activity.Width + 100dip
new_height = b.Height * ( Activity.Width / b.Width )
Panel_Wait.AddView(vv_sopra_pannello, 0, 0, new_width,new_height )
Else
new_height = Activity.Height + 100dip
new_width = b.Width * ( Activity.Height / b.Height)
Panel_Wait.AddView(vv_sopra_pannello, - ( new_width / 2 ) + ( Activity.Width / 2) , - (( new_height / 2 ) - ( Activity.Height / 2 )), new_width,new_height )
End If
'End Calculation Proportion movie
.......