Discussion Forums  >  Audio, Video, Playing, Recording

Replies: 4    Views: 101

Rad Doc
Apple Fan
Profile
Posts: 653
Reg: Oct 08, 2010
USA, NYC
8,580
06/04/12 10:21 AM (13 years ago)

Audio Stops when phone auto-locks

Hi All, I have an app that uses custom urls to stream music mixes from my server. The problem is the music shuts off when the phone goes into auto lock. Can anyone help me correct this issue. Anthony
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/04/12 01:08 PM (13 years ago)
The most common approach seems to be preventing the device from going into auto-lock when your app is running. My second comment here shows how to do this: http://www.buzztouch.com/forum/thread.php?tid=BB92F4422C6A46BCF190061
 
Rad Doc
Apple Fan
Profile
Posts: 653
Reg: Oct 08, 2010
USA, NYC
8,580
like
06/04/12 11:38 PM (13 years ago)
Hey David, I actually came across that same post earlier but i couldn't figure out where to drop that single line of code. Would it be the webview.m? Around Line # 129? Any help would be greatly appreciated. Thanks Anthony
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/04/12 11:44 PM (13 years ago)
[[UIApplication sharedApplication] setIdleTimerDisabled:YES]; "in the app delegate file when the app launches." Find your app's delegate file. Find the "didFinishLaunching" method. It's in that method that yo'll want to set the timerDisabled value to YES. The idea is that when your app first launches, you'll "turn on" the disabled property of the auto-lock timer. Then, your app won't ever enter auto-lock mode.
 
Rad Doc
Apple Fan
Profile
Posts: 653
Reg: Oct 08, 2010
USA, NYC
8,580
like
06/04/12 11:55 PM (13 years ago)
Thanks for the quick reply. Let me give it a try. I'll keep you posted. Anthony
 

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.