[wish] Complete Event in MediaPlayerStream

frapel

Active Member
Licensed User
Longtime User

frapel

Active Member
Licensed User
Longtime User
MediaPlayerStream Complete event is there (hidden...) and it works !!!

I know that the Complete event is not listed. However it is implemented. Please try to add it manually.

Thank you Erel !!! I implemented it manually and it does the work !!!
A couple of days ago I already tried this solution but it went wrong for one stupid mistake I did... :BangHead:

To give a clear example for other people, if you need to set a listener for the completion of an audio stream using MediaPlayerStream object, the following code is the way:

B4X:
Sub Process_Globals
     Dim mps As MediaPlayerStream
End Sub

Sub Activity_Create(FirstTime As Boolean)
     mps.Initialize("mps")

     'load and play the stream

     '...other code
End Sub

'this method will be called when the stream MediaPlayerStream is playing reaches the end
Sub mps_Complete
     ToastMessageShow("it works..." , True)
End Sub

This is exactly the same behavior we have in MediaPlayer object, but for MediaPlayerStream you must code the thing manually because the B4A IDE will not suggest you the Complete event (I'm sure Erel will fix it in future releases).

Again thx Erel, you solved me a big issue. :sign0142:
 
Top