Hi all,
Could someone please give me an example, how to handle the Completed event of MediaPlayer object? I have read the documentation, looked at tutorials. As I understood, you initialize the MediaPlayer object with Init2 and pass the event handler name. So I did the following:
Sub Process_Globals
dim MediaPlayer1 as MediaPlayer
...
End Sub
Sub Activity_Create(FirstTime As Boolean)
MediaPlayer1.Initialize2("MPStopped")
...
end Sub
Then, since I was not completely sure, what the name of event handler function should be, I have created 2 subs:
Sub MediaPlayer1_MPStopped
log("The playback has stopped")
end Sub
Sub MPStopped
log("MPStopped: the playback has stopped")
end Sub
Non of those methods are ever executed.
I started the playback, MediaPlayer plays fine, then I waited for playback to finish at the end of the song and did not get events to be fired.
I am probably doing something incorrectly, however was not able to find any example how to write event sub.
Would so much appreciate any clerifications.
Many thanks.
Igor.
Could someone please give me an example, how to handle the Completed event of MediaPlayer object? I have read the documentation, looked at tutorials. As I understood, you initialize the MediaPlayer object with Init2 and pass the event handler name. So I did the following:
Sub Process_Globals
dim MediaPlayer1 as MediaPlayer
...
End Sub
Sub Activity_Create(FirstTime As Boolean)
MediaPlayer1.Initialize2("MPStopped")
...
end Sub
Then, since I was not completely sure, what the name of event handler function should be, I have created 2 subs:
Sub MediaPlayer1_MPStopped
log("The playback has stopped")
end Sub
Sub MPStopped
log("MPStopped: the playback has stopped")
end Sub
Non of those methods are ever executed.
I started the playback, MediaPlayer plays fine, then I waited for playback to finish at the end of the song and did not get events to be fired.
I am probably doing something incorrectly, however was not able to find any example how to write event sub.
Would so much appreciate any clerifications.
Many thanks.
Igor.