rleiman Well-Known Member Licensed User Longtime User Jan 17, 2018 #1 Hi Everyone, I would like to test if the media player is initialized like: Code: Copy 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.
Hi Everyone, I would like to test if the media player is initialized like: Code: Copy 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.
Ricky D Well-Known Member Licensed User Longtime User Jan 18, 2018 #2 Use try catch for the error and proceed accordingly Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jan 18, 2018 #3 I will add it in the next update. You can use a global flag instead. Upvote 0
rleiman Well-Known Member Licensed User Longtime User Jan 18, 2018 #4 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
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.
Erel B4X founder Staff member Licensed User Longtime User Jan 18, 2018 #5 Service_Create of the starter service is the best place for all public process global variables. Upvote 0
rleiman Well-Known Member Licensed User Longtime User Jan 18, 2018 #6 Erel said: Service_Create of the starter service is the best place for all public process global variables. Click to expand... Upvote 0
Erel said: Service_Create of the starter service is the best place for all public process global variables. Click to expand...