0
您好我已經去解析和閱讀有關對象和文件,查詢以及我已經通過網絡,並試圖尋找方式來檢索.mov文件從解析和使用此方法:從解析中保存的視頻創建縮略圖圖像
- (UIImage *)loadImage:(NSString *)videoPath
{
// getting the frame of the video for the thumbnail
//NSString *videoPath = [[NSBundle mainBundle] pathForResource:image ofType:nil];
NSURL *vidURL = [NSURL URLWithString:videoPath];
AVURLAsset *asset = [[AVURLAsset alloc ] initWithURL:vidURL options:nil];
AVAssetImageGenerator *generate = [[AVAssetImageGenerator alloc] initWithAsset:asset];
NSError *err = NULL;
CMTime time = CMTimeMake(0, MPMovieTimeOptionNearestKeyFrame);
CGImageRef thumbImg = [generate copyCGImageAtTime:time actualTime:NULL error:&err];
return [[UIImage alloc] initWithCGImage:thumbImg];
}
才能夠使用該文件的縮略圖,現在我真的需要這裏的一些幫助,認真我一直在嘗試一切我能想到的IM乞請幫助我,我已經去分析的。 com論壇,沒有人回答我的問題,如何,我去了樹屋論壇,並沒有任何答案,沒有人知道或沒有人想回答這個問題,請幫助。
它已經兩個星期左右,因爲我被困在這個問題上
如果問我有沒有正確的清楚,請讓我知道,所以我會編輯的問題
我改變了的NSString參數NSURL,這就是我的cellForRowAtIndexPath PFFile *縮略圖= [地方object objectForKey:@「VidFIle」]; NSURL * url = [NSURL fileURLWithPath:thumbnail.url]; self.thumbnailImageV =(PFImageView *)[cell viewWithTag:100]; self.thumbnailImageV.image = [self loadImage:url]; – user2257386