在 iPhone 中同时播放两个视频
我想在 iPhone 中同时播放两个视频。
iPhone上播放视频有两种方式,一种是使用AVQueuePlayer
。但在这个控制器中我不知道如何完成视频播放以及如何再次重新启动视频。
另一种方法是 MPMoviePlayerController 。但在这个控制器中,我不知道如何在特定时间寻找视频,而且它也无法像 AVQueuePlayer 能够播放那样同时播放两个视频。
作为一种解决方案,我使用 AVQueuePlayer 来播放视频,但任何人都可以帮助我重新启动视频并获取检测视频终点的方法。或者知道任何其他 api,所以
提前致谢。
I want to play two video in iPhone simultaneously.
There are two way to play video in iphone, One is use AVQueuePlayer
. but in this controller I don't get how get the video playing is completed and how to restart video again.
Another way is MPMoviePlayerController
. but in this controller I don't get how to seek video at particular time and also it is not able to play two video simultaneously as the AVQueuePlayer
is able to play.
as a solution i am using AVQueuePlayer
to play video and but can any one help me to restart video and get method to detect end point of the video. or know any other api to so this
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我找到了播放两个视频的解决方案。您可以使用 AVQueuePlayer 来播放视频。使用此控制器您可以同时播放两个视频。
I have found the solution to play two video . You can use AVQueuePlayer to play video. Using this controller you can play two video at the same time .
我想知道这是否可能。硬件视频解码器确保 iPhone 上的视频播放。我真的认为硬件解码器一次只能处理一个视频流。
I wonder if this is even possible. Video playback on the iPhone is ensured thanks to a hardware video decoder. And I really think the hardware decoder can only handle one video stream at a time.
艾科是对的。由于硬件限制,您一次只能播放一个视频。
但是,如果您遵循 7KV7 建议的一个视频结束并触发另一个视频的播放,则可以通过以下方式使用 MPMoviePlayerPlaybackDidFinishNotification 通知:
另外,请注意,您可以通过检查来查找 MPMoviePlayerController 实例中的当前播放点
currentPlaybackTime
属性。Ecco is correct. You're limited to one video at a time due to hardware restrictions.
However, if you're after 7KV7's suggestion of one video ending and triggering the playback of another, you can make use of the MPMoviePlayerPlaybackDidFinishNotification notification in the following way:
Also, note that you can find the current playback point in a MPMoviePlayerController instance by examining the
currentPlaybackTime
property.