I am creating a Radio application , in that I want to keep my radio running even though the application goes to the background.
i.e. streaming must be continued , right now it gets stopped.
Please help me out from this situation
thanks
Add a "Required background modes" entry to your application .plist. This is an array, add an item of "App plays audio".
if you look at the plist source, it'll be:
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>
This might be worth looking into:
iPhone ios4 - Replacing iPod dock icon whilst playing background audio stream
Related
I was using an app called "sleep cycle" the other day and noticed that when I exit the app (and an alarm is set) a status bar appears prompting me to return.
I want to implement this feature in an app I'm currently working on, but do not know where to start/what the feature is even called. I have included an image of it below. Any input/advice is appreciated. Thank you!
This red bar is a system level bar shown to indicate the app is recording audio while in the background.
iOS uses different colors to indicate different things (the bar is green when on a phone call, for instance).
In order to implement this in your own app, you need to be recording audio in the background. The system will then show the bar to the user while the audio is being recorded. To add the audio background mode to your app, add the following key to your Info.plist:
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>
I'm creating a live audio streaming app using titanium studio (version 3.1.1). I need to enable background audio playback for iphone. Currently background audio works in android emulator but not in iphone sinulator (when I click the home button, audio fades away and stop). I created the audioplayer and set the audioSessionMode.
Ti.App.player = Ti.Media.createAudioPlayer({
url :'http://broadcast.infomaniak.net/radionova-high.mp3',
allowBackground :true
});
Titanium.Media.audioSessionMode = Ti.Media.AUDIO_SESSION_MODE_PLAYBACK;
When I add and save the following lines to Info.plist file and run the project, the file reloads and remove these lines. How do I correctly edit this file? or is there another way to get background audio in iphone?
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>
you basically add the section to your tiapp.xml.
here is a good blog post on the topic.
http://bencoding.com/2012/07/15/using-titanium-ios-specific-configurations/
When publishing to iOS device the game plays well, when hitting homebutton it disappears as normal, but next time you open it - it starts to play at the state or level it was when quitting - as it only was paused. It should start up from default startupscreen.
does anyone have the same problem? or solution tho this?
ps we had an 103 error that we solved with this:
http://kb2.adobe.com/cps/909/cpsid_90916.html
When you write an iPhone application, to disable the background mode, you have to set the "UIApplicationExitsOnSuspend" key to YES in the info.plist file.
When you develop mobile Air application the equivalent of the info.plist is located into the "name of the app"-app.xml. I have never tested it but you may have to specify it there like that:
<iPhone>
<InfoAdditions><![CDATA[
<key>UIDeviceFamily</key>
<array>
<string>1</string>
<string>2</string>
</array>
<key>UIApplicationExitsOnSuspend</key>
<true/>
]]></InfoAdditions>
<requestedDisplayResolution>high</requestedDisplayResolution>
</iPhone>
I hope it'll help you.
I made an app which allows an audio file (http://site/file.mp3) to be played in the background.
This all works great. I only want an play icon to be visible like this statusbar
See the 'play' icon in the top right.
I've googled my brains out and can't seem to find anything that explains how to achieve this.
Anyone?
You might need this in your plist:
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>
Other than that - it might be a part of linking your app to the iPod controls; which is answered here: iPhone ios4 - Replacing iPod dock icon whilst playing background audio stream
till know, i was aware of the fact is, we cant play background process in iPhone, but with 4.0 + we can do it.
i have a doubt, suppose we develop and music player application, which need to be play audio continiously, while the application has been closed.
Is this possible.
For example, the inbuilt music player of iPhone does this, if u play an audio, and close the app, it will continue playing the audio, untill you fully close the music player.
SO my doubht is, can we play music in background, while application is closed.???
Suggestions are always appreciated
regards
Open your plist file as a plain text file and add background modes as audio.
<dict>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>
// other codes
</dict>
All the Best.