修复bug

This commit is contained in:
liyuhua
2024-05-16 14:30:21 +08:00
parent 1723782767
commit b96f270acf
17 changed files with 195 additions and 152 deletions

View File

@@ -2053,11 +2053,12 @@
/// SVGA
- (void)playGiftEffect:(NSString *)vggUrl {
if ([self isInSudGame]) {return;}
NSString *fileName = [[vggUrl componentsSeparatedByString:@"/"] lastObject];
NSString *encodingUrl = [vggUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet];
NSString *fileName = [[encodingUrl componentsSeparatedByString:@"/"] lastObject];
NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) safeObjectAtIndex1:0] stringByAppendingPathComponent:@"GiftDynamicEffectList"];
NSString *fullPath = [filePath stringByAppendingPathComponent:fileName];
if ([[NSFileManager defaultManager] fileExistsAtPath:fullPath]){
NSData *data=[NSData dataWithContentsOfFile:fullPath options:0 error:NULL];
NSData *data = [NSData dataWithContentsOfFile:fullPath options:0 error:NULL];
[self.parser parseWithData:data cacheKey:nil completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
if (videoItem != nil) {
@@ -2160,8 +2161,8 @@
}
/// vap
- (void)playGiftEffectWithVapUrl:(NSString *)vapUrl {
NSString *fileName = [[vapUrl componentsSeparatedByString:@"/"] lastObject];
NSString *encodingUrl = [vapUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet];
NSString *fileName = [[encodingUrl componentsSeparatedByString:@"/"] lastObject];
NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) safeObjectAtIndex1:0] stringByAppendingPathComponent:@"GiftDynamicEffectList"];
NSString *fullPath = [filePath stringByAppendingPathComponent:fileName];
if ([[NSFileManager defaultManager] fileExistsAtPath:fullPath]){
@@ -2204,8 +2205,8 @@
- (void)playLuckyGiftEffect:(NSURL *)vggUrl {
if ([self isInSudGame]) {return;}
NSString *fileName = [[vggUrl.absoluteString componentsSeparatedByString:@"/"] lastObject];
NSString *encodingUrl = [vggUrl.absoluteString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet];
NSString *fileName = [[encodingUrl componentsSeparatedByString:@"/"] lastObject];
NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) safeObjectAtIndex1:0] stringByAppendingPathComponent:@"GiftDynamicEffectList"];
NSString *fullPath = [filePath stringByAppendingPathComponent:fileName];
if ([[NSFileManager defaultManager] fileExistsAtPath:fullPath]){
@@ -2283,8 +2284,8 @@
/// vap
- (void)playLuckyGiftEffectWithVapUrl:(NSString *)vapUrl {
NSString *fileName = [[vapUrl componentsSeparatedByString:@"/"] lastObject];
NSString *encodingUrl = [vapUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet];
NSString *fileName = [[encodingUrl componentsSeparatedByString:@"/"] lastObject];
NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) safeObjectAtIndex1:0] stringByAppendingPathComponent:@"GiftDynamicEffectList"];
NSString *fullPath = [filePath stringByAppendingPathComponent:fileName];
if ([[NSFileManager defaultManager] fileExistsAtPath:fullPath]){