我有一个自定义 UISider 控件,当我滑动控件时,我将 requestThumbnailImagesAtTimes 发送到 MPMoviePlayerController。
- (void)sliderPopoverView:(UISlider*)slider
{
self.currentSliderValue = slider.value;
[self.moviePlayer requestThumbnailImagesAtTimes:[NSArray arrayWithObject:[NSNumber numberWithDouble:self.currentSliderValue]]
timeOption:MPMovieTimeOptionNearestKeyFrame];
}
- (void)requestFinishThumbnail:(NSNotification*)notification
{
UIImage *thumbnailImage = [notification.userInfo objectForKey:MPMoviePlayerThumbnailImageKey];
if (thumbnailImage) {
_bottomView.sliderPopover.popover.thumbnailView.image = thumbnailImage;
}
}
然后我可以收到很多图片来展示。但是主线程被阻塞了。很难滑动自定义控件。花费大量时间。