美文网首页
过滤需要下载的文件

过滤需要下载的文件

作者: eb7a9dac29d0 | 来源:发表于2017-07-24 16:44 被阅读0次

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

}

}

}

相关文章

网友评论

      本文标题:过滤需要下载的文件

      本文链接:https://www.haomeiwen.com/subject/fnbbkxtx.html