B4X:
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Dim mp As MediaPlayer
Dim mv As MediaView
Dim msgbox As Msgboxes
End Sub
Sub AppStart (Form1 As Form, Args() As String)
msgbox.Show("put test.mp4 beside me(under objects)","info")
MainForm = Form1
MainForm.Title="play mp4 video"
MainForm.SetFormStyle("UNDECORATED")'no win title
MainForm.WindowLeft=0
MainForm.WindowTop=0
MainForm.WindowHeight=fx.PrimaryScreen.MaxY
MainForm.WindowWidth=fx.PrimaryScreen.MaxX
mp.Initialize("mp",File.geturi(File.DirApp,"test.mp4"))
mv.init("mv",MainForm.RootPane,mp)
MainForm.Show
End Sub
Sub mv_onready
Dim videowidth,videoheight As Double
videowidth=mv.MediaInfo.width
videoheight=mv.MediaInfo.height
Log("media size:"&videoheight&"-"&videowidth)
mv.FitHeight=videoheight
mv.FitWidth=videowidth
mp.Play
End Sub
Sub mp_Complete
msgbox.Show("play completed!","Tips")
End Sub