是否可以使用presentMoviePlayerViewControllerAnimated 播放多个剪辑?

发布于 2024-12-23 18:22:10 字数 160 浏览 1 评论 0原文

我有一种情况,我想使用使用presentMoviePlayerViewControllerAnimated 显示的MPMoviePlayerViewController 来连续播放2 个视频剪辑。

问题是,第一部电影完成后,模态视图会自动关闭。

有没有人找到办法做到这一点?

I have a situation where I'd like to play 2 video clips back to back using an MPMoviePlayerViewController displayed using presentMoviePlayerViewControllerAnimated.

The problem is that the modal view automatically closes itself as soon as the first movie is complete.

Has anyone found a way to do this?

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

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

发布评论

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

评论(2

染墨丶若流云 2024-12-30 18:22:10

三个选项:

您可以使用 MPMoviePlayerController 并在前一个项目完成后开始播放第二个(第 N 个)项目。然而,由于内容的识别和预缓冲,这将在视频之间引入小间隙。

您可以使用AVQueuePlayer; AVQueuePlayer 是 AVPlayer 的子类,用于按顺序播放多个项目。有关更多信息,请参阅其参考

您可以使用 AVComposition 在运行时从需要播放的两个(或 N 个)视频中合成一个视频。请注意,这仅适用于本地存储的视频,不适用于远程(流式传输或渐进式下载)。然后使用AVPlayer进行播放。

Three options:

You may use MPMoviePlayerController and start the playback of the 2nd (Nth) item after the previous is complete. This however will introduce a small gap between the videos cause by identification and pre buffering of the content.

You may use AVQueuePlayer; AVQueuePlayer is a subclass of AVPlayer you use to play a number of items in sequence. See its reference for more.

You may use AVComposition for at runtime composing one video out of the two (or N) you need to play back. Note, this works only on locally stored videos and not on remote (streaming or progressive download). Then use AVPlayer for the playback.

海夕 2024-12-30 18:22:10

这是不可能的。如果视频资源位于本地文件系统中,请考虑 AVComposition。

It's not possible. If the video assets are in local file system, consider AVComposition.

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