Skip to content

Commit 58d1ead

Browse files
author
ianyanzhang
committed
1. Update storage path
1 parent 0b5ab08 commit 58d1ead

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Demo/TXLiteAVDemo/SuperPlayerDemo/SuperPlayer/CacheView/VideoCacheView.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,8 @@ - (TXVodDownloadCenter *)manager {
625625
_manager = [TXVodDownloadCenter sharedInstance];
626626
_manager.delegate = self;
627627
// 设置下载存储路径
628-
NSString *cachesDir = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
628+
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
629+
NSString *cachesDir = [paths objectAtIndex:0];
629630
NSString *path = [NSString stringWithFormat:@"%@/videoCache",cachesDir];
630631
[_manager setDownloadPath:path];
631632
}

Demo/TXLiteAVDemo/SuperPlayerKit/SuperPlayer/SuperPlayerView.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ @implementation SuperPlayerView {
107107
#pragma mark - life Cycle
108108

109109
+ (void)initialize {
110-
NSString *path = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0];
110+
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
111+
NSString *path = [paths objectAtIndex:0];
111112
NSString *cachePath = [path stringByAppendingString:@"/TXCache"];
112113
[TXPlayerGlobalSetting setCacheFolderPath:cachePath];
113114
[TXPlayerGlobalSetting setMaxCacheSize:500];

0 commit comments

Comments
 (0)