减少播放远程视频内容时的初始延迟

发布于 2024-11-18 11:19:34 字数 82 浏览 6 评论 0原文

您好,使用 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 技术交流群。

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

发布评论

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

评论(1

疧_╮線 2024-11-25 11:19:34
  1. 使用
    [MPMoviePlayerControllerInstanceprepareToPlay]
    一旦您知道用户
    可能会开始播放电影。你
    可能还想要设置
    MPMoviePlayeController.autoPlay
    最适合的东西,取决于
    在您的应用程序上。

    来自 Apple 文档

    <块引用>

    这个方法被调用
    当您调用播放时自动
    方法。在打电话之前先打电话
    比赛让接收者有机会
    尽早准备物品,可能会导致
    减少启动时的延迟
    播放。然而,调用这个方法
    也可能会中断任何活动音频
    会议。

  2. 确保您的 HTTP 流包含
    低带宽替代方案使用
    低于 64Kbps(音频和视频合计)。请注意,
    MPMoviePlayerController 通常
    开始缓冲低速率
    之前播放索引配置文件
    提高标准并尝试
    加载更高的带宽配置文件。它
    将准备好进行比赛
    几秒钟的电影数据。

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

    来自 MPMoviePlayerController
    类参考

    <块引用>

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

  1. Use
    [MPMoviePlayerControllerInstance prepareToPlay]
    as soon as you know that the user
    might start playback of a movie. You
    might also want set
    MPMoviePlayeController.autoPlay to
    something that fits best, depending
    on your application.

    From Apple's Documentation;

    This method is called
    automatically when you call the play
    method. Calling it before you call
    play gives the receiver a chance to
    prepare items sooner and may result in
    decreased latency when starting
    playback. However, calling this method
    may also interrupt any active audio
    sessions.

  2. Make sure your HTTP stream contains
    a low bandwidth alternative using
    less than 64Kbps (audio and video combined). Note that the
    MPMoviePlayerController usually
    starts 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.

  3. Use the
    MPMoviePlayerController.movieSourceType
    property 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 和您的相关数据。
原文