我在 iPad 应用程序中使用 MPMoviePlayerController。视频未显示,但音频出现,相同的代码在 Iphone 上运行良好
NSBundle *bundle = [NSBundle mainBundle];
NSString *moviePath = [bundle pathForResource:@"video" ofType:@"mp4"];
movieURL = [NSURL fileURLWithPath:moviePath];
MPMoviePlayerController *IntroMovie = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
[IntroMovie play];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlaybackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:nil];
请推荐我
谢谢 米拉杰
最佳答案
您必须将影片 View 添加到 View Controller 中的现有 View 中,如下所示:
[self.view addSubview:IntroMovie.view]
关于iphone - MPMoviePlayerController 在 ipad 应用程序中使用的一些问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2568241/