使用 MPMoviePlayerController 在屏幕上显示多个视频

发布于 2024-12-01 05:43:11 字数 320 浏览 1 评论 0原文

我想要在这里实现的是一个屏幕同时显示 2 个或更多不同的视频。我知道在苹果文档中它说你不能同时播放多个视频,那很好,我不想这样做。

我想要的只是在屏幕上显示 2 个视频,当您按下它时,它就会开始播放,如果您愿意,您可以全屏显示,但一旦您按下另一个视频,旧视频就会停止,新视频就会开始。

我已经设置了三个 MPMoviePlayerController 并设置了正确的位置、大小和视频,并且 3 个框都绘制到了屏幕上,但目前,实际上只能观看最后一个绘制到屏幕上的框。

有谁知道是否有任何方法可以实现这一目标,如果是的话,我将如何去做?

谢谢,

马特

What I want to achieve here is a screen with 2 or more different videos on at a time. I know in the apple documentation it says you can't have more than one video playing at a time and thats fine, I don't want to do this.

All I want is to have the 2 videos on screen and when you press on it, it starts to play, you can go fullscreen if you want but as soon as you press on a different video, the old video stops and the new one starts.

I already have three MPMoviePlayerController set up with the correct position, size and video and the 3 boxes are all drawn to the screen but at the moment, only the last one to be drawn to screen can actually be watched.

Does anybody know if there is any way to achieve this or not and if so, how would I go about it?

Thanks,

Matt

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

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

发布评论

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

评论(1

Oo萌小芽oO 2024-12-08 05:43:11

据我所知,您同时只能拥有一名活跃的电影播放器​​。这是 MPMoviePlayerController 的限制。 Apple 文档中的消息:

注意:虽然您可以创建多个 MPMoviePlayerController 对象
并在您的界面中呈现他们的观点,同时只有一个电影播放器
时间可以播放它的电影。

来源:http://developer.apple。 com/library/ios/#documentation/mediaplayer/reference/MPMoviePlayerController_Class/Reference/Reference.html

As for as I know, you can only have one active movie player at the same time. It's a limitation from MPMoviePlayerController. Message in Apple documentation :

Note: Although you can create multiple MPMoviePlayerController objects
and present their views in your interface, only one movie player at a
time can play its movie.

Source : http://developer.apple.com/library/ios/#documentation/mediaplayer/reference/MPMoviePlayerController_Class/Reference/Reference.html

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