내 애플리케이션 번들에있는 QT 동영상을 실행하려고합니다. 그것을 작동시킬 수 없습니다. 누군가 조언 할 수 있습니까?QT 동영상을 애플리케이션 번들에 있습니다.
감사합니다.
NSError* error = nil;
NSString* moviePath = [NSBundle pathForResource:@"bundledMovie" ofType:@"mp4" inDirectory:[[NSBundle mainBundle] bundlePath]];
QTMovie* movie = [QTMovie movieWithFile:moviePath error:&error];
if(movie != nil)
{
[movieView setMovie:movie];
}
else
{
NSLog(@"Error loading movie: %@", [error localizedDescription]);
}
이
업데이트 : 당신은 NSURL을 사용하려면
, 다음을 사용
폴
-(IBAction)runInternalMovie:(id)sender
[
NSString *internalPath;
NSURL *internalURL;
QTMovie *internalMovie;
internalPath = [[NSBundle mainBundle] pathForResource: @"bundledMovie"
ofType: @"mp4"];
internalURL = [NSURL fileURLWithPath: internalPath];
internalMovie = [[QTMovie alloc] initWithURL: internalURL byReference: YES];
}