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 ?
is there a way to preload these video files instead of constantly loading them from disk ? I would like to play different videos randomly. And provide an .exe file that contains all media files..
You can reuse the same MediaView and call mv.RunMethod("setMediaPlayer", Array(NewMediaPlayer)) to replace the media player. I don't think that it will make any practical difference.