通过 m3u8 流式传输到 iphone [英] Streaming to iphone via m3u8

查看:86
本文介绍了通过 m3u8 流式传输到 iphone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在阅读有关通过 m3u8 在 iphone 上流式传输的信息,但我不确定我是否遗漏了什么.

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

有充分记录表明 MPMoviePlayerController 只能在 OS 3.1 中全屏播放,因此 iPhone 用户一直在观看视频(在我的情况下是听音频)并且无法在应用程序中导航.我还没有找到一种通过 m3u8 进行流式传输的方法,例如,使用 Matt Gallagher 的代码和 mp3...

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...

关于如何包含可以嵌入播放的 m3u8 播放器的任何想法?

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

谢谢!

推荐答案

如果你要播放音频,你可以使用 AVPlayer (https://developer.apple.com/documentation/avfoundation/avplayer) 或者,如果您还想要预缓冲,您可以使用 AVQueuePlayer (https://developer.apple.com/documentation/avfoundation/avqueueplayer) - 它们都使用 HTTP 直播流协议,但您应该使用苹果提供的工具对曲目进行分段:https://developer.apple.com/streaming/

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/

他们还有一个验证器,可以告诉您流是否正常.问题是 AVPlayer 在 iOS 4.0 和 AVQueuePlayer 从 4.1 可用.

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.

这篇关于通过 m3u8 流式传输到 iphone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆