使用AFNetworking流式传输视频并缓存视频以进行播放

abi*_*son 6 video-streaming afnetworking ios6

所以我想让我的应用程序流式传输位于Amazon S3上的视频.到目前为止,我可以用Apple的MediaPlayer教程做到这一点没问题:https://developer.apple.com/library/ios/#samplecode/MoviePlayer_iPhone/Introduction/Intro.html

但是,我在我的应用程序中使用RestKit,因此也在AFNetworking中使用.我看到AFNetworking正在使用缓存,所以我想知道是否可以对视频做同样的事情?我不知道如何使用AFNetworking流式传输视频.这将是一个良好的开端.我可以使用AFNetworking下载电影......但是我可以使用它进行流式传输,或者我应该只使用#import给出的流式传输系统

NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://s3.amazonaws.com/leclerc/videos/sop/IMG_0141.MOV"]];
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *path = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"IMG_0141.MOV"];
operation.outputStream = [NSOutputStream outputStreamToFileAtPath:path append:NO];

[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
    NSLog(@"Successfully downloaded file to %@", path);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    NSLog(@"Error: %@", error);
}];

[operation start];
Run Code Online (Sandbox Code Playgroud)

例如,如果我在Vevo上观看音乐片段然后在5分钟后重新播放,我是否必须在iPad上重新下载?这对我来说是全新的,对不起我的无知!