Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display multiple videos in single view?

I tried to display more than one vide in single frame using the following code

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];'

but i am getting only last video.

Can anyone tell me how to display more than one video in a single view. Thank You

like image 991
surendher Avatar asked Oct 08 '22 20:10

surendher


1 Answers

Because documentation says:

Note: Although you can create multiple MPMoviePlayerController objects and present their views in your interface, only one movie player at a time can play its movie.

like image 162
beryllium Avatar answered Oct 11 '22 10:10

beryllium