简体   繁体   中英

iPhone - Streaming audio with MPMoviePlayerViewController

I'm using MPMoviePlayerViewController to stream an audio from the 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. 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. That said the original AudioStreamer has been updated this year so I'd imagine it also has implemented background support by now.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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