gpt4 book ai didi

iphone - MPMoviePlayerController 延迟实际上应该没有

转载 作者:行者123 更新时间:2023-12-03 21:20:08 27 4
gpt4 key购买 nike

每次我的应用程序更改显示的动画(这是一部循环电影)时,他都会暂停,直到最终开始播放电影。MoviePlayerConntroller 是这样创建的

    self.moviePlayer = [MPMoviePlayerController alloc];
[moviePlayer initWithContentURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"NewChar" ofType:@"m4v"]] ];
// remove playerview from our view (no prob is he isnt attached to any)
[moviePlayer.view removeFromSuperview];
// tell our playerview the size he has to use
moviePlayer.view.frame = CGRectMake(0, 0, 320, 430);
// and add hin to the superview behind everything else
[self.view insertSubview:moviePlayer.view atIndex:0];
// no moviecontrolls
moviePlayer.controlStyle = MPMovieControlStyleNone;
// looping forever
moviePlayer.repeatMode= MPMovieRepeatModeOne;
// let him use his own Audio Session for old devices
moviePlayer.useApplicationAudioSession= NO;
// fix the silly black background on iOS 4.3
moviePlayer.view.backgroundColor = [UIColor clearColor];

实际的电影是这样播放的

[moviePlayer initWithContentURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Whatever" ofType:@"m4v"]]];
[moviePlayer play];

正如我所说,每次电影更换时,他都会花一段时间来显示它。在较新的设备上还可以,因为它们速度更快,但在 G2 上这有点令人不安。尝试准备播放,但这没有什么区别。

知道我错过了什么吗?

感谢您的阅读! :)

最佳答案

从磁盘加载电影需要时间,并且在旧设备上显然会更慢。视频有多大?

关于iphone - MPMoviePlayerController 延迟实际上应该没有,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5635937/

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