在 MPMoviePlayerController 上调用播放后,电影播放有一些延迟

发布于 2024-11-19 09:25:15 字数 324 浏览 9 评论 0原文

我正在开发一个 iPhone 应用程序,在其中使用 MPMoviePlayerController 播放视频。

有时,在我在 MPMoviePlayerController 上调用播放后,某些视频不会立即播放。

我已调用prepareToPlay,并在MPMediaPlaybackIsPreparedToPlayDidChangeNotification 的通知方法中,我正在MPMoviePlayerController 上调用播放。

有人可以帮助找出这里的问题吗?

谢谢, 拉克斯米拉尔

I am developing an iPhone application in which I play videos using MPMoviePlayerController.

Sometimes, some of the videos don't play immediately after I call play on MPMoviePlayerController.

I have called prepareToPlay and in the notified method of MPMediaPlaybackIsPreparedToPlayDidChangeNotification, I am calling play on MPMoviePlayerController.

Could someone help in identifying the problem here?

Thanks,
Laxmilal

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紧拥背影 2024-11-26 09:25:15

从我在类似线程中的回答(reducing-the-initial-播放远程视频内容时延迟) - 注意解决方案的此片段对于远程和本地视频内容均有效。

初始化时使用MPMoviePlayerController.movi​​eSourceType属性
播放器减少媒体
识别延迟。

来自 MPMoviePlayerController 类参考

该属性的默认值为
MPMovieSourceType 未知。这
属性提供了线索
播放系统应该如何
下载并缓冲电影内容。
如果您知道源类型
电影,设置 this 的值
播放开始之前的属性可以
改善电影的加载时间
内容。如果不设置源
在播放之前明确输入,
电影播放器​​控制器必须收集
这些信息可能会延迟
播放。

From my answer in a similar thread (reducing-the-initial-delay-when-playing-remote-video-content) - Note this fragment of the solution is valid for both, remote and local video content.

Use theMPMoviePlayerController.movieSourceTypeproperty when initializing your
player to cut down the media
recognition delay.

From the MPMoviePlayerController Class Reference:

The default value of this property is
MPMovieSourceTypeUnknown. This
property provides a clue to the
playback system as to how it should
download and buffer the movie content.
If you know the source type of the
movie, setting the value of this
property before playback begins can
improve the load times for the movie
content. If you do not set the source
type explicitly before playback, the
movie player controller must gather
this information, which might delay
playback.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文