添加视频到应用程序

时间:2012-05-24 04:43:26

标签: iphone objective-c ios memory-management video

我想在我的应用程序目录中存储大量视频。它会让我的申请变慢吗?或者需要时间来启动应用程序。我只在必要时加载视频。

2 个答案:

答案 0 :(得分:1)

它会使你的应用程序的大尺寸变得不好......&它也需要时间来代替保存所有你的视频你可以让用户从服务器下载该视频,之后它将被保存在你的doc目录中,所以你的应用程序将不是大尺寸...... .......

答案 1 :(得分:0)

它位于何处

  NSURL *url = [NSURL URLWithString:[[NSBundle mainBundle] pathForResource:@"videoname" ofType:@"mov" inDirectory:@""]];

然后玩那个

 MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];
 [[player view] setFrame:[self.view bounds]]; // Frame must match parent view
 [self.view addSubview:[player view]];
 [player play];
 [player release];

修改: -

这个问题的确切答案是否定的,它不会让你的应用程序变慢,但是,你的应用程序加载视频需要一些时间,时间取决于你在APP中加载的视频数量。对此的解决方案是您必须为ALAssetLibaries使用块。

查看此ALAssetLibary Apple's class reference

如果没有联系我,它可能会有所帮助。谢谢:))