It looks something like the thumbnailImageAtTime:timeOption: MPMoviePlayerController , you need to pass the time when you want to get the thumbnail and use this image to display the UIImageView on top of the video.
After you create the thumbnail, you will create a UIImageView and set the image to thumbnail and make sure you set userInteractionsEnabled to YES . Be sure to set the frame of this image to close the movie.
Now you can create a UITapGestureRecognizer in this image view that will call the method. This method then calls the play method of your MPMoviePlayerController object.
-(void)viewDidLoad{ [...] UIImage *thumbnail = [moviePlayer thumbnailImageAtTime:5.0 timeOption:MPMovieTimeOptionNearestKeyFrame]; UIImageView *iv = [[UIImageView alloc] initWithImage:thumbnail]; iv.userInteractionEnabled = YES; iv.frame = moviePlayer.frame; [self.view addSubview:iv]; [iv release]; UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)]; tap.numberOfTapsRequired = 1; [iv addGestureRecognizer:tap]; [tap release]; [...] } - (void)handleTap:(UITapGestureRecognizer *)gesture{ iv.hidden = YES; [moviePlayer play]; }
Note that if you want the play button to click the play button in Photoshop and add it on top of the thumbnail image, attach a gesture recognizer to this image view and make sure you hide both images when you start your video game.
You can use UIButton otherwise with the image set to the playback image, then you do not need UIGestureRecognizer at all.
Daniel
source share