Search code examples
iosstreammp3

How to play a mp3 stream integrated into iPod on iOS


I have a standard mp3 stream that is delivered through http. I use the approach used in this example project:

https://github.com/mattgallagher/AudioStreamer/

Basically it uses the approach described in Apples "Audio Stream Reference". If I set UIBackgroundModes to audio iOS plays the sound if the app is in the background.

But how can I make the iPod controls in the taskbar work? How can I integrate properly with iPod on iOS?


Solution

  • The controls in the taskbar fire remote-control events (for example like controls that are integrated into the head phones). If you follow the instructions described in Apples documentation Remote Control of Multimedia and set UIBackgroundModes to audio, then everything behaves as expected: If the app is suspended the sound continues to play, you app icon appears in the iPod menu in the taskbar and the buttons trigger events.