Hi guys
I need a little help to know whether something is possible or not....
So the idea behind the app is to have multiple Mediaplayers each playing a different audio file, which in this case are fruit machine sounds. This is to give the ambeinece of being inside an actual fruit machine arcade. The app has a number of mediaplayers within it, these are activated, loaded with an audio file and then played simultaneously.
What am then doing is it using the YouTube Library to then link these audio clips to a corresponding video file stored on YouTube, thus letting them see the video that corresponds to one of the audio files, but whilst still having the other sounds playing in the background (the ambience). This again on the whole seems to work well.
The Problem
The problem arises when the user presses the home button whilst watching the YouTube video. Everything closes as it should but the Mediaplayer keeps playing. Is there any way to monitor for this or a smilar occurrence so as to stop/pause the Media player as and when needed? I appreciate you cant catch the press of the home button but is there some other way to identify that the Media should not longer be playing (for example when the YouTube activity is paused etc) and stop them?
The dream is to keep the Media players playing alongside the YouTube video. This does work but I seem to be very liable to losing control of the Media players when the YouTube video is being watched :-( If the user presses back when watching the YouTube clip it comes back to the app app activity and it picks up where it left off and the mediaplayers are all stopped when needed.
I have attached the basics of what I have so far...
Any help or thoughts would be much appreciated
CAsh
I need a little help to know whether something is possible or not....
So the idea behind the app is to have multiple Mediaplayers each playing a different audio file, which in this case are fruit machine sounds. This is to give the ambeinece of being inside an actual fruit machine arcade. The app has a number of mediaplayers within it, these are activated, loaded with an audio file and then played simultaneously.
What am then doing is it using the YouTube Library to then link these audio clips to a corresponding video file stored on YouTube, thus letting them see the video that corresponds to one of the audio files, but whilst still having the other sounds playing in the background (the ambience). This again on the whole seems to work well.
The Problem
The problem arises when the user presses the home button whilst watching the YouTube video. Everything closes as it should but the Mediaplayer keeps playing. Is there any way to monitor for this or a smilar occurrence so as to stop/pause the Media player as and when needed? I appreciate you cant catch the press of the home button but is there some other way to identify that the Media should not longer be playing (for example when the YouTube activity is paused etc) and stop them?
The dream is to keep the Media players playing alongside the YouTube video. This does work but I seem to be very liable to losing control of the Media players when the YouTube video is being watched :-( If the user presses back when watching the YouTube clip it comes back to the app app activity and it picks up where it left off and the mediaplayers are all stopped when needed.
I have attached the basics of what I have so far...
Any help or thoughts would be much appreciated
CAsh