MPMoviePlayerViewController加载大视频文件时崩溃应用程序

时间:2012-05-24 14:03:35

标签: iphone xcode

我正在使用MPMoviePlayerViewController播放MP4文件。它适用于小文件(例如25-30 MB),但在播放大文件(~150 MB)时会崩溃应用程序。

以下是我正在使用的代码:

MPMoviePlayerViewController *playerViewController = [[MPMoviePlayerViewController   alloc]initWithContentURL:url];
playerViewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentMoviePlayerViewControllerAnimated:playerViewController];

player = [playerViewController moviePlayer];

[player prepareToPlay];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playerInterruptByUser:) name:MPMoviePlayerPlaybackStateDidChangeNotification object:playerViewController.moviePlayer];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playerFinished:) name:MPMoviePlayerPlaybackDidFinishNotification object:playerViewController.moviePlayer];

[player play];

任何建议伙伴/加尔斯。

0 个答案:

没有答案