Discussion Forums  >  Uncategorized

Replies: 12    Views: 1457

mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
02/15/11 07:25 AM (15 years ago)

iPod stops playing

I have both the v 1.4 and v 1.5 of my app on my iPhone and one thing I've noticed is that if I'm listening to music with the iPod app, the music continues when I open v 1.4 but stops when opening v 1.5. Is there a way to fix this so music continues?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
02/15/11 09:59 AM (15 years ago)
There's always a way ;-) KIndly post the name of the project you're workign on and the EXACT name of the menu item or button that needs to be pressed to start the music your're talking about. The fix is going to depend on a few things and we need to get a look at what your're doing to figure this out. Your helping us will will also help others.
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
02/15/11 02:59 PM (15 years ago)
I don't want to start music when the app launches, I just want the music I was already listening to to keep playing. in other words, how do I keep the iPod app running in the background? The iPod app stops when I open my v 1.5 app but continuesnplaying whennopening the 1.4 version.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
02/18/11 12:18 AM (15 years ago)
Does this mean you're talking about.... a) you create a Streaming Music screen b) v1.4 allows the music to keep plaing, v1.5 stop it when the app is pushed to the background c) Are you using a file for the sound (in the Xcode project) or a URL for the sound? d) Does the sound stop in v1.5 when you leave the screen (navigate to another screen in the app) or when you push the phones Home button?
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
02/18/11 05:24 AM (15 years ago)
No. I'm not trying to create a music stream or do anything with music on my app. I am trying to make my app a good resource for emergency medicine doctors. There will be lots of study material, links to blogs, etc. It would be nice if they could listen to music from the native ipod app on the iphone while viewing my app. So, if you go into the ipod app and start playing music then close the ipod app, the music continues in the background. If I then open the 1.4 version of MY app the music continues playing allowing me to view the different resources on MY app while and listen to my music at the same time. However, when I try to open up the 1.5 version of MY app, the native ipod app stops playing music so I'm stuck viewing the resources on my app in deafening silence. Its not that big of a deal that I want to include music in my app but it would be nice if I could prevent the background ipod app from closing. Make sense?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
02/18/11 10:19 AM (15 years ago)
Makes perfect sense! Looking into it...
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
03/19/11 04:46 AM (14 years ago)
Hi David! Have you got any solution to the problem of the iPod shuts down when starting a BT v1.5 app?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/19/11 07:59 AM (14 years ago)
Hi I found a solution that allows the iPod to continue when the app launches. I'll get it on the download server soon... in the meantime, you can make this adjustment to your project source-code. The adjustment should prevent the iPod from stoping when the app loads. a) Find [yourAppName]appDelegate.m file in the BT_Config folder (in Xcode) b) Comment out the line that initializes the application sound effects, around line 113 [NSThread detachNewThreadSelector: @selector(loadSoundEffects) toTarget:self withObject:nil]; change to... //[NSThread detachNewThreadSelector: @selector(loadSoundEffects) toTarget:self withObject:nil]; note the two backslashes. You're just commenting this out to iOS ignore this and does NOT turn initialize the background sounds player. c) Recompile your app. This should prevent the iPod from turning off if it's already playing. If you have configured any background sounds or sound-effects in your control panel, they will not play. We'll get a more permenent solution on the download server soon. Please re-post and tell us if this worked for you.
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
03/19/11 08:13 AM (14 years ago)
Nice. You are the king!
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
03/20/11 05:19 PM (14 years ago)
I love it! I updated my app with the changes you listed and my app now loads and the ipod doesn't shut off. There is still a problem though... or maybe just more of a nuance that I can probably live with. If I have the ipod running it will keep running when my app launches. Then, if I select a feature that plays a mp3 file then the ipod stops (as it should) and the mp3 file plays. However, after I stop the mp3 file and close the app it goes back to the way it was before... meaning that if ipod is playing and I open the app ipod stops. The only way I can get it to work again so far is to delete the app on my phone and reinstall it. Then ipod will continue playing in the background. But as soon as I try to play one mp3, regardless of what I do afterwards, the ipod app will no longer run in the background.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/21/11 12:08 AM (14 years ago)
Yea, this makes sense (bogus but technically speaking I can see how it happens). What iOS version is this iPod running? I'm asking becuase I have a few ideas but they depend on the iOS version. What you're dealing with is an 'audio session' issue. Before the last change you made (a few posts ago), your app was hijacking the audio-session, and killing the iPod, when it first launched. This was because it was preparing to play some sound effects that it didn't need. So.. it doesn't do this now. But... it DOES hijack the audio-session when a SONG is played inside the app. As it should. But, when your app is pushed to the background, it doesn't seem to be letting the audio-session go. Again, IOS version dtermines the adjustment. Lemme know.... a) App Name b) Audio file (mp3 in app that hijacks audio) c) How to find the mp3 in the app (what menu, etc) d) iPod iOS version you're running.
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
03/21/11 07:00 AM (14 years ago)
Makes sense. Here's my info... a) erres b) 100.mp3 c) choose the codes icon, then CPR metronome d) iphone 4.3
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
03/21/11 07:02 AM (14 years ago)
there's also a test screen under CODES that does that same thing. I was playing around with whether to have a link to an mp3 directly or have a html file with custom background and have the mp3 play in the background. Both both of these cause the same problem. Thanks!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.