MPMoviePlayerController獲取的Thumbnail image老是null

先用requestThumbnailImagesAtTimes方法獲取thumbnailImage:

MPMoviePlayerController *aplayer = [[MPMoviePlayerController alloc] initWithContentURL:_mediaUrl];

    self.moviePlayer = aplayer;

    _moviePlayer.controlStyle = MPMovieControlStyleEmbedded;

    _moviePlayer.view.frame = _moviePic.bounds;

    _moviePlayer.shouldAutoplay = NO;

    [_moviePlayer prepareToPlay];

    [_moviePlayer requestThumbnailImagesAtTimes:[NSArray arrayWithObject:[NSNumber numberWithDouble:1.0]] timeOption:MPMovieTimeOptionExact];

    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(movieThumbnailLoadComplete:) name:MPMoviePlayerThumbnailImageRequestDidFinishNotification object:nil];

    [aplayer release];

 

接收消息

-(void)movieThumbnailLoadComplete:(NSNotification*)notification

{

    NSLog(@"%@",notification.userInfo);

    NSDictionary *userInfo = [notification userInfo];  

    UIImage *image =[userInfo objectForKey: @"MPMoviePlayerThumbnailImageKey"];

}

 

打印出來的thumbnail image老是nan,究竟是爲何呢?是否是隻能獲取本地視頻的縮略圖呢?
相關文章
相關標籤/搜索