简体   繁体   English

如何在 iOS 上播放集成到 iPod 中的 mp3 stream

[英]How to play a mp3 stream integrated into iPod on iOS

I have a standard mp3 stream that is delivered through http.我有一个通过 http 交付的标准 mp3 stream。 I use the approach used in this example project:我使用此示例项目中使用的方法:

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

Basically it uses the approach described in Apples "Audio Stream Reference" .基本上它使用 Apples "Audio Stream Reference"中描述的方法。 If I set UIBackgroundModes to audio iOS plays the sound if the app is in the background.如果我将UIBackgroundModes设置为audio iOS 如果应用程序在后台播放声音。

But how can I make the iPod controls in the taskbar work?但是我怎样才能使任务栏中的 iPod 控件工作呢? How can I integrate properly with iPod on iOS?如何在 iOS 上与 iPod 正确集成?

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.如果您按照 Apple 文档Remote Control of Multimedia中描述的说明并将UIBackgroundModes设置为audio ,那么一切都会按预期运行:如果应用程序暂停,声音会继续播放,您的应用程序图标会出现在任务栏的 iPod 菜单中,并且按钮触发事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM