B4J Question How to play different mp4 with mediaplayer?

bjfhs

Active Member
Licensed User
I know how to play mp4 with mediaplayer. and before play it. you need initiate it with the filename. but how can I change the file to another when it playing.
For example
B4X:
    Dim m As MediaPlayer
    Dim mv As JavaObject
    m.Initialize("m",File.GetUri(File.DirApp ,"qd.mp4"))
    mv.InitializeNewInstance("javafx.scene.media.MediaView",Array(m))
    Pane1.AddNode(mv,0,0,1024,768)
    m.Play
But how can i change it play another file when this is playing?
 
Last edited:
Top