Android Question Testing if the media player is initialized

rleiman

Well-Known Member
Licensed User
Longtime User
Hi Everyone,

I would like to test if the media player is initialized like:

B4X:
If mpMyMediaPlayer.IsInitialized Then
   ' Do somthing.
End If

but could not find .IsInitialized in the current version of b4a since most of the objects that are available do have that in them. I need to stop the media player from playing only if it's initialized, otherwise trying to do that and it's not initialized will crash the app.

Is there another media player library available?

Thanks.
 

rleiman

Well-Known Member
Licensed User
Longtime User
Hi Everyone,

Thanks for the helpful replies.

I moved the coding to initialize the media player to the Service_Create sub routine so I can call another sub routine from my main activity to control the media player in the service without fear of crashing the app.
 
Upvote 0
Top