我嘗試使用下面的代碼如何在單個視圖中顯示多個視頻?
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];'
顯示在單個幀以上的韋迪,但我只得到了最後一個視頻。
誰能告訴我如何在單個視圖中顯示多個視頻。謝謝