3

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?

Eimantas
  • 48,927
  • 17
  • 132
  • 168
basvk
  • 4,437
  • 3
  • 29
  • 49

1 Answers1

4

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

Community
  • 1
  • 1
Wex
  • 4,434
  • 3
  • 33
  • 47
  • I added the key UIBackgroundModes to my plist, else I wouldn't be able to continue playing the audio when I close the app or 'turn off' my iPad. I'll give that link a try, thanks. – basvk Apr 07 '11 at 09:40
  • 1
    Works like a charm! Follow-up: How can I receive events from these (http://www.rogueamoeba.com/utm/wp-content/uploads/images/20100622tray.png) buttons? – basvk Apr 07 '11 at 09:58
  • 1
    That's done in the link I posted - by using remoteControlReceivedWithEvent – Wex Apr 07 '11 at 10:04
  • 1
    Ah I found the problem, I called the beginReceivingRemoteControlEvents and becomeFirstResponder instance methods from within the -(void)viewDidLoad and not in -(void)viewDidAppear:(BOOL)animated – basvk Apr 07 '11 at 11:11
  • 1
    adding audio to UIBackgroundModes does not make the play icon appear in the statusbar – Nick Dowell Aug 26 '12 at 15:39