Discussion Forums  >  Audio, Video, Playing, Recording

Replies: 20    Views: 148

lsills81
Apple Fan
Profile
Posts: 469
Reg: Mar 19, 2012
location unknow...
14,090
07/15/12 04:45 PM (13 years ago)

Setup BG audio to play after app closes....like Pandora

Here is short video showing what Alex@TM and @RadDoc did. Like the title says....setup both embedded or URL based audio to play continuously. Will even work in the lock screen after a double tap of the home button. http://youtu.be/Q4-ig9ERaYA
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
07/16/12 06:08 AM (13 years ago)
Well done! I've got an app that could really use this feature! Any chance of documenting the code snippets and perhaps a screen shot of the xcode properties? It was difficult to make out on the screencast. TIA
 
lsills81
Apple Fan
Profile
Posts: 469
Reg: Mar 19, 2012
location unknow...
14,090
like
07/16/12 06:21 AM (13 years ago)
I included a PDF of all the code needed. It's in the YouTube description. It has exactly what you need.
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
07/16/12 06:25 AM (13 years ago)
Thanks! I should have taken a better look ... usually only find nasty comments under the videos from trolls on youtube ;) Much appreciated!!!
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
07/16/12 06:26 AM (13 years ago)
Can you check the link? I get a 404 file not found from dropbox.
 
lsills81
Apple Fan
Profile
Posts: 469
Reg: Mar 19, 2012
location unknow...
14,090
like
07/16/12 06:35 AM (13 years ago)
Not sure what happened there....here is the link. Thank you for bringing this to my attention. https://www.dropbox.com/s/mf3zksibasjz7il/Background%20Audio%20Setup.pdf
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
07/16/12 07:10 AM (13 years ago)
thanks. been meaning to deploy/test this in a 2.0 but still not a fan of bkg audio as a whole. but the streaming radio and non stop audio i am a fan of. never finished up my notes but i have a hunch your code/tips will work pretty similarly on 2.0 Self Hosted. thanks.
 
lsills81
Apple Fan
Profile
Posts: 469
Reg: Mar 19, 2012
location unknow...
14,090
like
07/16/12 07:15 AM (13 years ago)
@atrain53 can you help me get this going on 2.0? There is NO audio.m file in 2.0 (as I know you know) and that is where you add 70% of the code. Thanks for you help
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
07/16/12 07:53 AM (13 years ago)
Try the code in the BT_audioPlayer.m file that's in the BT_Core folder. The box for controls starts at line 95 and that code looks similar to where you have it in the 1.5. I'm curious to test this myself and see what kind of controls you get for the audio.....hopefully later this afternoon. IIRC You had a post about changing the backround screen too up here too? Looking at that file i see a 'mask entire screen' function. I wonder if the answer to your background image might lie in this file too....? make a copy of the file and go to town, this is the best way to learn!
 
lsills81
Apple Fan
Profile
Posts: 469
Reg: Mar 19, 2012
location unknow...
14,090
like
07/16/12 08:00 AM (13 years ago)
THANK YOU THANK YOU THANK YOU!!! PS: Everytime I see @ATRAIN53 in my inbox I get all excited as I know I am about to learn something new. :)
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
07/17/12 07:13 AM (13 years ago)
Thanks. Your guides have been quite helpful as well. Just about to start playng with Parse soon and glad to know i have a good references to follow. Keep making them, great stuff. I'm learnign here too- I've been thinking 'background audio' in terms of music that plays when you launch the app (or like a website which i have always HATED.) But now that I look at this closer and see what you are using it for, I understand it better. This is essential to add to apps. My neighbor was just griping about an app he uses that doesn't do this and how much he wished it did. I tried applying your code to the 2.0 and it is not working. Lots of similar code but some differences there. Let me have some time to compare them and see. Reverse engineering the BT code is tricky and i have to break it down in smaller pieces first. I was also checking out the Apple Developer note on this here: http://developer.apple.com/library/ios/#qa/qa1668/_index.html They use the AudioToolbox which I want to try adding and see if it makes any difference. Interesting to see it works in 1.5 without that toolbox and the tech docs clearly say to import it....
 
lsills81
Apple Fan
Profile
Posts: 469
Reg: Mar 19, 2012
location unknow...
14,090
like
07/17/12 07:24 AM (13 years ago)
@ATRAIN53 thanks. Today I am doing a tutorial for printing....(I hope that I am) so I will post that later. Looking forward to seeing what you come up with.
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
07/18/12 04:55 PM (13 years ago)
If I set up the audio as a custom url, would this work in Quicktime?
 
lsills81
Apple Fan
Profile
Posts: 469
Reg: Mar 19, 2012
location unknow...
14,090
like
07/18/12 04:59 PM (13 years ago)
Yup...and since it is Quicktime you can control the music from within your lock screen and when you are in the muti-tasking part of iOS.
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
07/19/12 11:21 AM (13 years ago)
Say, I can't get the Android to work at all. Does anyone know what type of audio file will work on Android? I initially had an m4a file on my website, and when that didn't work I converted it to an mp3 file. Then I tried to set it up as background audio (mp3 is the file format). It works perfectly in iOS, but not in Android. I could set it up either way, as background audio or in the custom url, but right now neither way seems to work in Android. Thanks!
 
lsills81
Apple Fan
Profile
Posts: 469
Reg: Mar 19, 2012
location unknow...
14,090
like
07/19/12 11:26 AM (13 years ago)
I think in order to get audio to work in Android you have to do that in BTv2.0. @Fred seems to be the expert with Android here and I remember him saying that.
 
lsills81
Apple Fan
Profile
Posts: 469
Reg: Mar 19, 2012
location unknow...
14,090
like
07/19/12 01:14 PM (13 years ago)
Here is a list of compatible formats for Android. http://developer.android.com/guide/appendix/media-formats.html
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
07/19/12 01:30 PM (13 years ago)
It is good to know that it works. I am working in 2.0. I looked at the list of file types that are supported, and both mp3 and m4a are listed. So maybe it is just my devices--maybe I need to set up a player or something. If I don't figure it out I will send a message to Fred. Thank you!
 
lsills81
Apple Fan
Profile
Posts: 469
Reg: Mar 19, 2012
location unknow...
14,090
like
07/19/12 04:09 PM (13 years ago)
Keep us posted!
 
tonycelestino
Aspiring developer
Profile
Posts: 213
Reg: Jun 24, 2011
Maceio
4,080
like
07/30/12 05:36 PM (13 years ago)
Thanks @lsills81 I was looking for this hack for a while, glad you got it working.
 
lsills81
Apple Fan
Profile
Posts: 469
Reg: Mar 19, 2012
location unknow...
14,090
like
07/30/12 05:44 PM (13 years ago)
@tonycelestion Word!
 

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.