Dim cc As ContentChooser
cc.Initialize("cc")
cc.show("video/*", "Choose video")
Wait For cc_Result(Success As Boolean, Dir As String, FileName As String)
If Success Then
ToastMessageShow("Video choosed with success!", True)
Try
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_READ_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult (Permission As String, ResultCkeck As Boolean)
If ResultCkeck Then
Dim folder As String = Starter.Provider.SharedFolder
Dim newFileName As String = "1.mp4"
Dim out As OutputStream
Dim input As InputStream
input = File.OpenInput(Dir , FileName)
out = File.OpenOutput(folder, newFileName , False )
File.Copy2(input, out)
out.Close
'Log(File.Size(folder, newFileName))
Dim vidfile As String = File.Combine(folder, newFileName)
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", -5, "java.lang.long", 2, "java.lang.int")
Dim i, j As Int
i = b.Height * 0.3
j = b.Width * 0.5
icVideoMediaAtividadeSuspeitaSvBullying.Bitmap = b.Resize(j,i,True)
End If
Catch
Log(LastException)
End Try
Else
ToastMessageShow("The video wasn't selected!", True)
End If