B4J Question Javafx MediaPlayer

Abdou1283

Member
Licensed User
Longtime User
Solved, it work now.
B4X:
Dim mp As JavaObject=m   ' m is the mediaPlayer Object

Dim onReady As Object = mp.CreateEventFromUI("java.lang.Runnable","onReady",False)
mp.RunMethod("setOnReady",Array(onReady))

Dim onError As Object = mp.CreateEventFromUI("java.lang.Runnable","onError",False)
mp.RunMethod("setOnError",Array(onError))

Sub onError_Event(MethodName As String, Args() As Object) As Object
    Log("Error")
End Sub

Sub onReady_Event(MethodName As String, Args() As Object) As Object
    Log("Ready...")
End Sub
 
Upvote 0
Top