I can not write the whole code for you, but giving you a short piece of code to help you.
You make a scrollView, having thumbnail images of what video to play and save the urls in an array respectively then
**In VideoPlayContoller.h**
#import <MediaPlayer/MediaPlayer.h>
@interface VideoPlayViewController : UIViewController{
MPMoviePlayerController *moviePlayerController;
}
@property (nonatomic, readwrite) int i;
@property (nonatomic, retain) NSMutableArray *allVideoUrls;
-(void)playVideo:(int)_index;
- (IBAction)onTapBack:(id)sender;
@end
**In VideoPlayContoller.m**
#import "VideoPlayViewController.h"
#import <MediaPlayer/MediaPlayer.h>
@implementation VideoPlayViewController
@synthesize i,allVideoUrls;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
allVideoUrls = [[NSMutableArray alloc]init];
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
[self playVideo:i];
}
-(void)playVideo:(int)_index{
NSURL *fileURL = [NSURL URLWithString:[allVideoUrls objectAtIndex:i]];
if(!moviePlayerController){
moviePlayerController = [[MPMoviePlayerController alloc] init];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlaybackComplete:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayerController];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(doneButtonClick:) name:MPMoviePlayerWillExitFullscreenNotification object:nil];
}
moviePlayerController.fullscreen = YES;
[moviePlayerController setContentURL:fileURL];
if([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0){
[moviePlayerController.view setFrame:CGRectMake(0, 62, 320, 504)];
}
else{
[moviePlayerController.view setFrame:CGRectMake(0, 62, 320, 416)]; //y = 42
}
[self.view addSubview:moviePlayerController.view];
[moviePlayerController play];
}
- (IBAction)onTapBack:(id)sender {
[moviePlayerController stop];
[self dismissModalViewControllerAnimated:NO];
}
- (void)moviePlaybackComplete:(NSNotification *)notification{
i++;
[moviePlayerController stop];
[moviePlayerController.view removeFromSuperview];
[self dismissModalViewControllerAnimated:NO];
[self dismissModalViewControllerAnimated:NO];
}
-(void)doneButtonClick:(NSNotification*)aNotification{
NSLog(@"Done button Clicked");
[self dismissModalViewControllerAnimated:NO];
}