Can anybody help me in this? I want to get an screenshot from an video playing through MPMediaPlayerController. What i have tried so far is:-
-(void)viewDidL
U can merge two image from this way.Please have an look from the below code..
- (UIImage*) maskImage:(UIImage *)image withMask:(UIImage *)maskImage {
MaskView=[[UIView alloc] init];
UIImageView *image1=[[UIImageView alloc]init];
UIImageView *image2=[[UIImageView alloc]init];
MaskView.frame=CGRectMake(0, 0,500,500);
image1.frame=CGRectMake(0,0,160, 160);
image2.frame=CGRectMake(60,54,40,40);
image1.image=image;
image2.image=maskImage;
[MaskView addSubview:image1];
[MaskView addSubview:image2];
UIGraphicsBeginImageContext(CGSizeMake(160,160));
[MaskView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *finishedPic = UIGraphicsGetImageFromCurrentImageContext();
return finishedPic;
}
This may help
- (UIImage *)thumbnailImageAtTime:(NSTimeInterval)playbackTime timeOption:(MPMovieTimeOption)option
Get the thumbnailImage at the given time and scale that image.
You just have to call a single method on your mpmovieplayer object:
- (UIImage *)thumbnailImageAtTime:(NSTimeInterval)playbackTime timeOption:(MPMovieTimeOption)option
this method will return a UIImage object. what you have to do is just:
UIImage *thumbnail = [player thumbnailImageAtTime:1.0 timeOption:MPMovieTimeOptionNearestKeyFrame];
for more details look at MPMoviePlayerController
Hope this helps
EDIT: In your method you can first hide player's control and than capture Image after that show controls again. you can achive this using controlStyle property of MPMoviePlayerController.
Not sure this is what you are looking for but it is what I understood. If you are looking for different let me know.