0
我使用此代碼回放上IOS 6的視頻(在Xcode和設備仿真器)IOS問題具有視頻播放
- (void) playMovie {
NSString *filepath = [[NSBundle mainBundle] pathForResource:@"flying" ofType:@"m4v"];
NSURL *fileURL = [NSURL fileURLWithPath:filepath];
MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];
[moviePlayerController prepareToPlay];
[moviePlayerController.view setFrame: self.view.bounds];
[self.view addSubview:moviePlayerController.view];
moviePlayerController.scalingMode = MPMovieScalingModeAspectFit;
moviePlayerController.movieSourceType = MPMovieSourceTypeFile;
[moviePlayerController play];
}
播放開始時,但在5秒後的視頻中止。它只是消失,我看到一個黑色的窗口,Xcode中沒有錯誤消息。
任何線索? 謝謝