0

How can I take screenshot when playing the video in MPMoviePlayer? I am using the below code for take screenshot but the player screen is black color. 1)

- (UIImage*)captureScreenshot:(UIView *)view {
        CGRect screenRect = [[UIScreen mainScreen] bounds];
        UIGraphicsBeginImageContext(screenRect.size);

        CGContextRef ctx = UIGraphicsGetCurrentContext();
        [self.view.layer renderInContext:ctx];

        UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();

        UIImageWriteToSavedPhotosAlbum(viewImage, self, nil, nil);
        return viewImage;
    }

2) CGImageRef originalImage = UIGetScreenImage();

This is apple banned.

Please give any other way to get screenshot from the movie player. Please help me.

Mani
  • 1,310
  • 1
  • 20
  • 40

1 Answers1

0

Somewhat hacktastic, but you could take a screenshot, grab a thumbnail from the movie player (e.g. as suggested here) and overlay the second on the first.

Community
  • 1
  • 1
beaudrykock
  • 248
  • 2
  • 17