是否可以在同一视图中同时播放 2 个视频文件?
是否可以在同一视图中同时播放 2 个视频文件?
我想让它们都在屏幕的一半以上播放,有点像这样:
_ _ _ _ _ _ _ _ _ _ | | | | | VIDEO | | | |_ _ _ _ _ _ _ _ _ _| | | | | | VIDEO | | | |_ _ _ _ _ _ _ _ _ _|
我将如何实现这一目标?
谢谢 :)
Is it possible to play 2 video files simultaneously in the same view?
I want to do have them both playing over half the screen, a little like this:
_ _ _ _ _ _ _ _ _ _ | | | | | VIDEO | | | |_ _ _ _ _ _ _ _ _ _| | | | | | VIDEO | | | |_ _ _ _ _ _ _ _ _ _|
How would I go about accomplishing this?
Thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
苹果的文档说:
虽然你可以创建多个MPMoviePlayerController对象并在你的界面中呈现它们的视图,但一次只能有一个电影播放器可以播放它的电影。
所以,你知道...
apple's document said:
Although you may create multiple MPMoviePlayerController objects and present their views in your interface, only one movie player at a time may play its movie.
so,you know...
一次播放 2 个视频是可能的。
步骤:
1.创建 2 个 MPMoviePlayer 实例
2.使用 CGRectMake 为 2 个播放器设置帧
3.将 2 个播放器添加到视图(self.view)
I希望以上步骤对您有帮助。
播放器设置框架仅支持 iOS 3.2 及以上版本。
如果您有任何疑问,请告诉我。
示例代码:
Play 2 video's at a time is possible..
STEPS:
1.create 2 instance of MPMoviePlayer
2.set frame for 2 player by using CGRectMake
3.Add 2 players to the view(self.view)
I hope above steps are helpful for u.
setting frame for player only supported in iOS 3.2 and above versions.
Let me know you have any doubt.
Sample Code:
您可以使用AVPlayer同时播放两个视频,查看Layer的帧即可获得所需的帧请按照以下链接< /a>.
You can use AVPlayer to play two video simultaneously seeting frame of Layer you can get the required frame Please follow following link.