gpt4 book ai didi

ipad - MPMoviePlayerViewController 未出现

转载 作者:行者123 更新时间:2023-11-29 05:06:45 28 4
gpt4 key购买 nike

我正在尝试为标题/启动屏幕加载一部小电影。但是,当我调用 presentMoviePlayerViewControllerAnimated 时,什么也没有发生。我已经确认该代码块正在执行,但用户无法感知到任何内容。

我的目标是 iPad,因此假设为 3.2。

如有任何帮助,我们将不胜感激。

- (void)viewDidLoad {
[super viewDidLoad];

NSString *path = [[NSBundle mainBundle] pathForResource:@"Intro" ofType:@"m4v" inDirectory:nil];
NSURL *fileURL = [NSURL fileURLWithPath:path];
MPMoviePlayerViewController *playerView = [[MPMoviePlayerViewController alloc] initWithContentURL:fileURL];
[[NSNotificationCenter defaultCenter] addObserver:self selector: @selector(playbackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:playerView.moviePlayer];
[self presentMoviePlayerViewControllerAnimated:playerView];
[playerView release];
}

- (void)playbackDidFinish:(NSNotification*)aNotification {
MPMoviePlayerController *player = [aNotification object];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
[player stop];
[self dismissMoviePlayerViewControllerAnimated];
}

最佳答案

你应该放置这条线 [玩家 View 发布];后这条线[ self 解雇MoviePlayerViewControllerAnimated];

关于ipad - MPMoviePlayerViewController 未出现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4784964/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com