减少播放远程视频内容时的初始延迟
您好,使用 MPMoviePlayerController 将视频流式传输到应用程序中。但是,加载需要很长时间,我希望能够预先缓冲视频。有什么建议吗?
Hi using MPMoviePlayerController to stream video into the app. However, it takes a long time to load and I want to be able to pre-buffer the video. Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
[MPMoviePlayerControllerInstanceprepareToPlay]
一旦您知道用户
可能会开始播放电影。你
可能还想要设置
MPMoviePlayeController.autoPlay
到最适合的东西,取决于
在您的应用程序上。
来自 Apple 文档;
<块引用>
这个方法被调用
当您调用播放时自动
方法。在打电话之前先打电话
比赛让接收者有机会
尽早准备物品,可能会导致
减少启动时的延迟
播放。然而,调用这个方法
也可能会中断任何活动音频
会议。
确保您的 HTTP 流包含
低带宽替代方案使用
低于 64Kbps(音频和视频合计)。请注意,
MPMoviePlayerController
通常开始缓冲低速率
之前播放索引配置文件
提高标准并尝试
加载更高的带宽配置文件。它
将准备好进行比赛
几秒钟的电影数据。
使用
MPMoviePlayerController.movieSourceType
初始化时的属性
播放器减少媒体
识别延迟。
来自 MPMoviePlayerController
类参考:
<块引用>
该属性的默认值为
MPMovieSourceType 未知。这
属性提供了线索
播放系统应该如何
下载并缓冲电影内容。
如果您知道源类型
电影,设置 this 的值
播放开始之前的属性可以
改善电影的加载时间
内容。如果不设置源
在播放之前明确输入,
电影播放器控制器必须收集
这些信息可能会延迟
播放。
Use
[MPMoviePlayerControllerInstance prepareToPlay]
as soon as you know that the user
might start playback of a movie. You
might also want set
MPMoviePlayeController.autoPlay
tosomething that fits best, depending
on your application.
From Apple's Documentation;
Make sure your HTTP stream contains
a low bandwidth alternative using
less than 64Kbps (audio and video combined). Note that the
MPMoviePlayerController
usuallystarts buffering the low rate
playback index profile before
raising the bar and attempting to
load higher bandwidth profiles. It
will be prepared to play once it has
a few seconds worth of movie data.
Use the
MPMoviePlayerController.movieSourceType
property when initializing your
player to cut down the media
recognition delay.
From the MPMoviePlayerController
Class Reference: