I need to get the screenshot of a video on click of a button.Below is the code used for that,but the image shows only the down part of the video that is the play,next,prev etc..
CGRect rect = [_moviePlayer.view bounds];
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[_moviePlayer.view.layer renderInContext:context];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 100, 100, 100)];
[imgView setImage:image];
imgView.layer.borderWidth = 2.0;
[_firstimage addSubview:imgView];
NSURL *url=[NSURL URLWithString:@"http://ift.tt/1dOzwuu"]; this is the url used .
this is how it shows..How can i get the video image? Can anybody help me..
Aucun commentaire:
Enregistrer un commentaire