Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 10    Views: 91

othmane
Apple Fan
Profile
Posts: 105
Reg: Feb 08, 2012
Casablanca
1,050
05/21/13 07:34 AM (12 years ago)

Audio Streamer not playing in Background

Hi, This is an amazing plugin! I want being able to get it to play in the background, ie sleep or outside of the app? Thanks in advance
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/21/13 08:01 AM (12 years ago)
 
Alex@TM
Apple Fan
Profile
Posts: 956
Reg: Dec 20, 2011
London, UK
10,560
like
05/21/13 08:11 AM (12 years ago)
This is how I have successfully enabled audio in sleep, navigating within the app and outside of the app. Audio does stop when a call comes in too. - Add array and string to Custom IOS Target Properties. - Add the following code in the audio.m file //Adds ability for audio to play even in screen lock NSError *setCategoryErr = nil; NSError *activationErr = nil; [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: &setCategoryErr]; [[AVAudioSession sharedInstance] setActive: YES error: &activationErr]; - Remove following code from the delegate.m file //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]
 
othmane
Apple Fan
Profile
Posts: 105
Reg: Feb 08, 2012
Casablanca
1,050
like
05/21/13 08:42 AM (12 years ago)
Thank you very much Dragon007 and Alex@TM, I'll follow the instructions given by Alex and let you know
 
Alex@TM
Apple Fan
Profile
Posts: 956
Reg: Dec 20, 2011
London, UK
10,560
like
05/21/13 09:00 AM (12 years ago)
Cool, let me know if you have any issues adding the array and string to the info.plist
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
05/21/13 09:12 AM (12 years ago)
Hi othmane, Have your read "Audio in the Background" in the manual? http://www.bt-addons.com/images/bt_addons/manuals/audiostreamer_manual.pdf Hope this helps. Best Regards, Danny
 
Alex@TM
Apple Fan
Profile
Posts: 956
Reg: Dec 20, 2011
London, UK
10,560
like
05/21/13 09:18 AM (12 years ago)
Haha, thats the first part I in my instruction, I take it the code is not required? This was how to fix the original audio player in 1.5 and found it worked with your streamer :)
 
othmane
Apple Fan
Profile
Posts: 105
Reg: Feb 08, 2012
Casablanca
1,050
like
05/21/13 09:27 AM (12 years ago)
Thank you Danny, i missed to follow the manual's instructions. The problem is now fixed. Best Regards.
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
05/21/13 09:28 AM (12 years ago)
Hi, @Alex: No code is needed for audio in the background. Just the setting(s) as described. Really easy!! Best Regards, Danny
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
05/21/13 09:30 AM (12 years ago)
Hi, @othmane: glad you solved it. Lots of people forget/ignore manuals but sometimes they come in handy......:-) Best Regards, Danny
 
othmane
Apple Fan
Profile
Posts: 105
Reg: Feb 08, 2012
Casablanca
1,050
like
05/21/13 09:35 AM (12 years ago)
Thank you Danny, i missed to follow the manual's instructions. The problem is now fixed. Best Regards.
 

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.