如何在单个视图中显示多个视频?

sur*_*her 5 iphone xcode objective-c

我尝试使用以下代码在单帧中显示多个视频

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];'
Run Code Online (Sandbox Code Playgroud)

但我只得到最后一个视频.

任何人都可以告诉我如何在一个视图中显示多个视频.谢谢

ber*_*ium 4

因为文档说

注意:虽然您可以创建多个 MPMoviePlayerController 对象并在界面中显示它们的视图,但一次只有一个电影播放器​​可以播放其电影。