Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 0    Views: 116

Alex@TM
Apple Fan
Profile
Posts: 956
Reg: Dec 20, 2011
London, UK
10,560
06/06/12 08:13 AM (13 years ago)

Audio Streaming revisitied! Play Background Audio..

Hi all, I have read the excellent guidance here 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= and followed the instruction to the letter. For some reason the audio stops when coming out of the app or locking the screen. I have managed a work around on an app i built natively by adding the Required background modes array to the info.plist with the app plays audio string and simply calling the radio station using NSURLRequest, loading as a webview and allowing the device to take over from there. This has not only allowed perfect streaming from radio shows but also allows it to continue playing from outside of the app and on lock screen. I really need to be able to do the same with buzztouch created apps. I notice in the delegate.m that there is code controlling the audiosession to allow for such activity //setup audio session for background sounds. Allow iPod to continue if it's already playing. [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryAmbient error: nil]; [[AVAudioSession sharedInstance] setActive: YES error: nil] As I say, I've followed the instruction but am at a loss now. It is imperative I allow the audio to continue as opposed to stopping the device from locking. Does anyone have an additional help or suggestions that will see a fix with this please? Many thanks all. Alex
 

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.