B4J Question show video on background with label on it

Olivier Zeegers

Member
Licensed User
Hello,

I am trying to create a B4J project in fullscreen that shows a video in the background.
I have to place a label on top of the video to show an increasing number as well as a button.
How do I send the dynamically created mediaplayer to the back ?

this is my code in AppStart

B4X:
Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
    MainForm.RootPane.LoadLayout("Main")
    
    
    Dim m As MediaPlayer
    Dim mv As JavaObject
    
    m.Initialize("m",File.GetUri("C:\Users\Olivier\Downloads","Fireworks - 5269.mp4"))
    mv.InitializeNewInstance("javafx.scene.media.MediaView",Array(m))
    MainForm.RootPane.AddNode(mv,0,0,-1,-1)
    
    m.Play

    Dim jfs As JavaObject = MainForm
    Dim stage As JavaObject = jfs.GetField("stage")
    stage.RunMethod("setFullScreen", Array As Object(True))

    MainForm.Show
End Sub

thank you
 
Top