私はここに新しいです。私はすでに2日間解決策を閲覧していますが、不満です.
これが私のコードです:
NSString *docPath = [NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *docaPathFull = [docPath stringByAppendingPathComponent:@"/IMG_0003.m4v"];
self.videoURL = [NSURL fileURLWithPath:docaPathFull];
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];
UIImage *thumbnail = [player thumbnailImageAtTime:4.0 timeOption:MPMovieTimeOptionExact];
player = nil;
self.imageView.image = thumbnail;
問題は、MPMoviePlayerController でビデオ ファイルを表示できないことです。サムネイルを取得できず、再生できません。黒いプレーヤーとロード無限大だけです。
私は試しました:
NSString*thePath=[[NSBundle mainBundle] pathForResource:@"IMG_0003" ofType:@"m4v"];
self.videoURLtheurl=[NSURL fileURLWithPath:thePath];
この
self.videoURL = [[NSBundle mainBundle] URLForResource:@"IMG_0005" withExtension:@"mov"];
この
NSString *filePath = @"/Users/[user]/Documents/video/IMG_0004.mov";
self.videoURL = [NSURL fileURLWithPath:filePath];
私の命を救う方法があれば教えてください!!!
ありがとうございました。