如何将视频添加到iphone模拟器 [英] How to add video to iphone simulator

查看:94
本文介绍了如何将视频添加到iphone模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁能告诉我如何在iPhone模拟器中添加视频,以便我可以测试我正在处理的一些应用程序?提前致谢!

Can anyone tell me how to add video the iPhone simulator so that I can test some apps I am working on? Thanks in advance!

推荐答案

okey,试试这个:

okey, try this:

- (void) downloadVideo {
NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://sepwww.stanford.edu/sep/jon/trash/poolwaves.mov"]];

您可以将temp.mov更改为temp.m4v以将视频保存在m4v中。

You can change the temp.mov to temp.m4v to save the vid in m4v.

NSString *tempPath = [NSString stringWithFormat:@"%@/temp.mov", NSTemporaryDirectory()];
[imageData writeToFile:tempPath atomically:NO];
UISaveVideoAtPathToSavedPhotosAlbum (tempPath, self, @selector(video:didFinishSavingWithError: contextInfo:), nil);
}


- (void) video: (NSString *) videoPath
didFinishSavingWithError: (NSError *) error
   contextInfo: (void *) contextInfo {
    NSLog(@"Finished saving video with error: %@", error);
}

如果你将url更改为你的moviefile,这应该可以正常工作.. 。
电影保存在这个目录中: / Library / Application Support / iPhone Simulator / 4.3.2 / Media / DCIM
但你是对的,如果我将文件复制到它,它将不会出现在模拟器中

if you change the url to your moviefile, this should work really well... the movies are saved in this directory: /Library/Application Support/iPhone Simulator/4.3.2/Media/DCIM but you are right, if i copy a file to it, it won't show up in the simulator

greets

这篇关于如何将视频添加到iphone模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆