Sub PlayVideo(SubDir As String, filename As String, repeat As Boolean)
Dim mp As MediaPlayer
Dim jo,mv As JavaObject
mp.Initialize("mp",File.geturi(SubDir,filename))
mv=jo.InitializeNewInstance("javafx.scene.media.MediaView",Array As Object(mp))
pnlContent.AddNode(mv,0,0,OutputWindow.Width,OutputWindow.Height)
mv.RunMethod("setPreserveRatio", Array(False))
mv.RunMethod("setX",Array(0.0))
mv.RunMethod("setY",Array(0.0))
mv.RunMethod("setFitWidth",Array(pnlContent.Width))
mv.RunMethod("setFitHeight",Array(pnlContent.Height))
If repeat = True Then
mp.CycleCount = -1
End If
mp.Play
End Sub