简体   繁体   English

iPhone-使用MPMoviePlayerViewController流音频

[英]iPhone - Streaming audio with MPMoviePlayerViewController

I'm using MPMoviePlayerViewController to stream an audio from the URL "http://ios-audio.q-music.be/audio.m3u8". 我正在使用MPMoviePlayerViewController从URL“ http://ios-audio.q-music.be/audio.m3u8”流式传输音频。 Its playing well. 它的演奏很好。 But when I click "Home" button, the app goes into background and stops streaming. 但是,当我单击“主页”按钮时,该应用程序进入后台并停止流式传输。 When I start the app again, it starts streaming again. 当我再次启动该应用程序时,它将再次开始流式传输。

How can I make my app stream the audio using MPMoviePlayerController when the app goes to background. 当应用程序进入后台时,如何使我的应用程序使用MPMoviePlayerController流音频。 Or do I've to use other frameworks? 还是我必须使用其他框架?

好吧,我使用https://github.com/mattgallagher/AudioStreamer进行音频流传输,它将在后台运行。

http://digitaldj.net/2010/08/25/ios4-background-audio-revisited/ points to a fork of Matt Gallagher's original AudioStreamer code at http://github.com/DigitalDJ/AudioStreamer , which I can verify does support background audio. http://digitaldj.net/2010/08/25/ios4-background-audio-revisited/http://github.com/DigitalDJ/AudioStreamer上指向 Matt Gallagher的原始AudioStreamer代码的分支,我可以验证支持背景音频。 That said the original AudioStreamer has been updated this year so I'd imagine it also has implemented background support by now. 就是说,最初的AudioStreamer今年已更新,因此我想它现在也已实现了后台支持。

Certainly using MPMoviePlayerController to do background audio would be interesting since it presumably opens up the opportunity to support AirPlay directly in an audio streamer application. 当然,使用MPMoviePlayerController进行背景音频会很有趣,因为它大概为直接在音频流应用程序中支持AirPlay提供了机会。

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

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