如何在单个视图中显示多个视频?
问题描述:
我尝试使用下面的代码如何在单个视图中显示多个视频?
NSBundle *bundle=[NSBundle mainBundle];
NSString *moviePath1=[bundle pathForResource:@"tom1" ofType:@"mp4"];
NSURL *movieUrl1=[NSURL fileURLWithPath:moviePath1];
MPMoviePlayerController *movie1=[[MPMoviePlayerController alloc]initWithContentURL:movieUrl1];
movie1.view.frame=CGRectMake(15, 15, 80, 80);
[videoScrollViewObj addSubview:movie1.view];
NSBundle *bundle1=[NSBundle mainBundle];
NSString *moviePath2=[bundle1 pathForResource:@"tom2" ofType:@"mp4"];
NSURL *movieUrl2=[NSURL fileURLWithPath:moviePath2];
MPMoviePlayerController *movie2=[[MPMoviePlayerController alloc]initWithContentURL:movieUrl2];
movie2.view.frame=CGRectMake(15, 110, 80, 80);
[videoScrollViewObj addSubview:movie2.view];'
显示在单个帧以上的韦迪,但我只得到了最后一个视频。
谁能告诉我如何在单个视图中显示多个视频。谢谢
答
注意:虽然您可以在 时间才能发挥它的电影创建多个对象的MPMoviePlayerController和 在你的界面提出自己的看法,只有一个电影播放器。
答
铍说 - 它采用了苹果现有的观点
你可以尝试实现自己的播放器,从文件中抓取帧,并将其显示到视图中是不可能的。