iPhone - Streaming audio with MPMoviePlayerViewController

人盡茶涼 提交于 2019-12-11 06:56:36

问题


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?


回答1:


Well I use https://github.com/mattgallagher/AudioStreamer for streaming audio, It will work in background.




回答2:


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.



来源:https://stackoverflow.com/questions/6956847/iphone-streaming-audio-with-mpmovieplayerviewcontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!