MPMoviePlayerController& .m3u8播放列表 [英] MPMoviePlayerController & .m3u8 playlist
问题描述
我想在MPMoviePlayerController中使用包含远程mp4文件的.m3u8播放列表,你有没有成功?
I would like to use a .m3u8 playlist containing remote mp4 files with MPMoviePlayerController, did you success with this ?
-
.m3u8是否必须包含.ts文件?
如果不是.ts的目的是什么?
Does the .m3u8 must contain .ts file ?
If not what is the purpose of .ts ?
下一个/上一个按钮是否会启用一次要加载播放列表吗?
如果没有,这些按钮的用途是什么?
Does next / previous buttons will be enable once the playlist be loaded ?
If not, what is the purpose of these buttons ?
最后一个问题,你有吗? m3u8样本文件与远程mp4文件进行测试?
And last question, do you have a .m3u8 sample file with remote mp4 file to test ?
非常感谢您的帮助。
Thierry
推荐答案
因为你在谈论 .m3u8
和 .ts
文件,我可以假设您对iPhone OS 3.0和Snow Leopard支持的HTTP Live Streaming感兴趣吗?有关HTTP Live Streaming的更多信息,请参阅文档。
Since you're talking about .m3u8
and .ts
files, can I assume you're interested in HTTP Live Streaming, as supported by iPhone OS 3.0 and Snow Leopard? There is more info about HTTP Live Streaming in the documentation.
- 在HTTP直播中,
.m3u8
文件列出要按顺序下载和播放的其他文件。如果.m3u8
文件不包含#EXT-X-ENDLIST
指令,则客户端假定源是一个实时流,并定期重新提取.m3u8
以查找要下载的新媒体文件。.ts
文件是包含多路复用音频和视频的MPEG-2 trasnsport流文件(尽管传输流是MPEG-2规范的一部分,内容应该是是H.264和AAC,音频和视频编解码器通常与MPEG-4相关联。您有时会看到其他内容,例如.aac
,仅用于纯音频流。服务器会将视频流分段为多个.ts
个文件,.m3u8
文件将为这些<$提供网址c $ c> .ts 文件,客户端将按顺序下载并播放.ts
文件。作为iPhone开发人员,您所要做的就是将.m3u8
URL提供给MPMoviePlayerController
,它将处理休息。 - 不知道上一个/下一个按钮...看起来他们在流上下文中没有意义,我不确定是否
MPMoviePlayerController
甚至可以显示它们。您可以使用movieControlMode
属性来设置向用户提供的控件。 - Apple的 docs 提供一些样本测试模式流的链接。
- In HTTP Live Streaming, the
.m3u8
file lists other files that are to be downloaded and played in order. If the.m3u8
file doesn't contain an#EXT-X-ENDLIST
directive, then the client assumes the source is a live stream, and periodically re-fetches the.m3u8
to find new media files to download. The.ts
files are MPEG-2 trasnsport stream files that contain muxed audio and video (despite the fact that the transport stream is part of the MPEG-2 spec, the contents should be H.264 and AAC, the audio and video codecs usually associated with MPEG-4). You sometimes see other contents, like.aac
for audio-only streams. A server will segment a video stream into many.ts
files, the.m3u8
file will provide URLs for these.ts
files, and a client will download and play the.ts
files in order. As an iPhone developer, all you have to do is provide the.m3u8
URL to theMPMoviePlayerController
, which will handle the rest. - Don't know about the prev/next buttons... don't seem like they'd make sense in a stream context, and I'm not sure whether the the
MPMoviePlayerController
even shows them. You can use themovieControlMode
property to set what controls are offered to the user. - Apple's docs provide links to some sample test pattern streams.
这篇关于MPMoviePlayerController& .m3u8播放列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!