B4J Question remove node or re-initialize ?

Olivier Zeegers

Member
Licensed User
Hi,

I create a mediaplayer in runtime via this code:

B4X:
Private m As MediaPlayer
Private mv As JavaObject

    m.Initialize("m",File.GetUri("D:\Kiwanis\2018-2019\Sportcommissie\DonkerRun\Rode Knop","effect5.mp4"))
    mv.InitializeNewInstance("javafx.scene.media.MediaView",Array(m))
    MainForm.RootPane.AddNode(mv,0,0,1000,1000)
    mv.RunMethod("toBack",Null)

this creates a video that plays in the background when i call m.Play

Now, every now and then I want to play a different video....

When I re-initialize the mediaplayer object with the same code but a different filename nothing happens.
When I try to create another mediaplayer I cannot view the video probably because the first video is projecting over it ?
When I try to remove the node in runtime I have to give an index of which node to remove ?

Any suggestions ?

thank you
 

Olivier Zeegers

Member
Licensed User
Is there an event that is called when mediaplayer ends playing the video file ?

I play the video in the background while the user still can interact with the interface and want to play a new video when the old video is finished.

thank you
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top