English 中文(简体)
将视频添加到应用程序
原标题:Adding videos to application

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

最佳回答

这将使您的应用程序大得不妙... & amp; 还需要时间才能启动, 以取代保存所有 ur 视频 u, 使用户能够从服务器下载视频, 之后它将保存在 ur doc 目录中, 所以 ur 应用程序不会大.........

问题回答

总部所在地是何地

  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];

<强度 > EDIT:-

这个问题的确切答案是 否, 它不会使您的 App 慢速, 但是 确实, 将视频装入您的 App, 时间将取决于您在 App 中装入的视频数量。 解决这个问题的解决方案是您必须使用 ALAsssetLibaries 的块块 。

请查看此 < a href=" "http:// developmenter.apple.com/library/ios/#documentation/AsssetsLibrary/Reference/AL AssetsLibrary_Class/Reference/Reference.html" rel="nofollow" >ALAsssetLibary苹果类参考 。

如果联系不上我,会帮助你。





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签