过滤需要下载的文件

2017-07-24  本文已影响0人  eb7a9dac29d0

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

}

}

}

上一篇 下一篇

猜你喜欢

热点阅读