我像这样构建电影播放器......
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:url];
player.view.frame = myView.bounds;
player.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[player prepareToPlay];
[myView addSubview:player.view];
self.mp = player;
url 指向一个 m3u8 网络流。它播放得很好。然后我要求这样的图像......
NSTimeInterval currentInterval = self.mp.currentPlaybackTime;
UIImage *image = [self.mp thumbnailImageAtTime:currentInterval timeOption:MPMovieTimeOptionExact];
我尝试将 currentInterval 备份一秒钟。我已经尝试了两种时间选项(精确和关键帧),但图像始终为零。知道为什么吗?谢谢。