Streaming to iphone via m3u8

孤人 提交于 2019-12-30 07:03:48

问题


I've been reading around about streaming on the iphone via m3u8 but I'm not sure if I'm missing something.

It is well documented that MPMoviePlayerController will only play full-screen in OS 3.1, so iPhone users are stuck watching the video (listening to audio, in my case) and can't navigate in the application. I haven't found a way to stream via m3u8 like you can, for example, using Matt Gallagher's code and an mp3...

any ideas on how to include a m3u8 player that will play embedded?

thanks!


回答1:


If I got it right you want to play an mp3 playlist on OS 3.1 using the standard media player without having it on screen.

If this is right I suggest you to move your application window on top of the video screen with this:

appDelegate.window.windowLevel = 2

If your main window is opaque you will not see the player, never. I don't know if the native player supports M3U files, in the worst case you have to intercept the MPMoviePlayerPlaybackDidFinishNotification event and then play the next file.

Hope this helps.




回答2:


Well if you'll play audio you could use AVPlayer (https://developer.apple.com/documentation/avfoundation/avplayer) or, if you want pre-buffering as well, you could use AVQueuePlayer (https://developer.apple.com/documentation/avfoundation/avqueueplayer) - they both work with the HTTP live streaming protocol but you should fragment your tracks by using the tools provided by apple: https://developer.apple.com/streaming/

They also have a validator which tells you if the streams are ok. The problem is that AVPlayer is available from iOS 4.0 and AVQueuePlayer from 4.1.



来源:https://stackoverflow.com/questions/2715015/streaming-to-iphone-via-m3u8

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