- (void)getWillDownFile:(NSString *)videoURL{
if (videoURL.length > 6)
{
NSArray *tempArray = [videoURL componentsSeparatedByString:@"/"];
NSString *getUrl = [NSString stringWithFormat:@"%@",tempArray[tempArray.count - 1]];
NSString *cachesPath = [ExtensionObject fileExist:@"resource"];
NSString *videoUrl = [NSString stringWithFormat:@"%@/%@",cachesPath,getUrl];
NSFileManager* fileManager = [NSFileManager defaultManager];
//取得一个目录下得所有文件名
NSArray *fileArray = [fileManager subpathsAtPath:cachesPath];
if (![fileArray containsObject:getUrl]) {
[self DownLoad:_DownLoadURL];
}else{
[self playVideo:videoUrl];
}
}
}
网友评论