The method requestThumbnailImagesAtTimes:timeOption:will send a notification MPMoviePlayerThumbnailImageRequestDidFinishNotificationwhen the image request is completed.
Your code that needs a sketch must sign up for this notification using NSNotificationCenter and use the image when it receives the notification.
Example.
Register first for notification : MPMoviePlayerThumbnailImageRequestDidFinishNotification
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleThumbnailImageRequestFinishNotification:)
name:MPMoviePlayerThumbnailImageRequestDidFinishNotification
object:nil];
Then request a sketch:
[movie requestThumbnailImagesAtTimes:YOUR_TIMES timeOption:MPMovieTimeOptionExact]
And then get the image:
-(void)handleThumbnailImageRequestFinishNotification:(NSNotification*)notification
{
NSDictionary *userInfo = [notification userInfo];
UIImage *image = [userInfo valueForKey:MPMoviePlayerThumbnailImageKey];
}
Source: MPMoviePlayerController class reference
source
share