Discussion Forums  >  Audio, Video, Playing, Recording

Replies: 4    Views: 131

rdrye2000
Code is Art
Profile
Posts: 24
Reg: Jan 08, 2012
Atlanta
240
05/08/12 11:23 PM (13 years ago)

Audio Playback even when Auto-Lock turns on...

Great discussion about 9 months ago on this topic which seemed to have a conclusion. http://www.buzztouch.com/forum/thread.php?tid=95D786F2233610A930AE45F&command=isSearching&currentPage=1&topicTitle=auto-lock&createdBy=&repliedBy=&minViews=-1&maxViews=-1&minReplies=-1&maxReplies=-1&forumCategory= I have followed all the steps (including the final that was added when others had a problem). BT1.5 on iOS...trying to get embedded mp3 to continue playing once auto-lock sets. I feel comfortable that I have followed the advice correctly, but my music still shuts off. Any new ideas? Did something change with the latest Xcode update?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
05/09/12 03:01 AM (13 years ago)
No new info in iOS 5xxx that I'm aware of. I would be suspect of your Audio Session setup. Without seeing how you did it, I'm guessing the native iOS audio player object is not "connected" to the Audio Session you've created. Dunno, just a hunch. Could it be the you're playing audio using a different method (HTML5 maybe?) and not the native iOS player? Not sure what to add that hasn't been discussed in the post you referenced.
 
rdrye2000
Code is Art
Profile
Posts: 24
Reg: Jan 08, 2012
Atlanta
240
like
05/09/12 06:18 AM (13 years ago)
Using BT 1.5 with background music on a custom HTML page. Followed all the directions...cleaned, rebuilt, etc Still shuts off when phone auto locks Must be me, but not sure why???
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
05/09/12 10:38 PM (13 years ago)
Ah, maybe I didn't read this correct the first time. Auto Lock is different than your app going to the background. This is a great question and I don't think the Audio Session discussion from earlier has anything to do with this. One idea is to simply prevent the device from going into auto lock when your app is running. Something like: [[UIApplication sharedApplication] setIdleTimerDisabled:YES]; in the app delegate file when the app launches. Research the syntax, going from memory and my memory sucks! Also, keep in mind that Apple may frown upon the use of this logic but you could do some testing to see how it worked before worrying about Apple's opinion. Then, if it worked, see if it's allowed? Not sure really. Preventing Auto Lock seems like the best approach.
 
rdrye2000
Code is Art
Profile
Posts: 24
Reg: Jan 08, 2012
Atlanta
240
like
05/11/12 02:18 AM (13 years ago)
David...Thanks! I believe this is going to work...and I added some ambient lighting to justify the need to disable auto-lock. Seems to work well and reverts to auto-lock once outside of the app. FYI...I placed it in the BT_screen_audio.m
 

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.