FIX: 修复加载图片类型通用飘屏时不显示并会卡住所有后续数据的问题

This commit is contained in:
eggmanQQQ
2024-07-15 19:05:47 +08:00
parent c5428785c1
commit 3723161b8f
3 changed files with 43 additions and 32 deletions

View File

@@ -111,9 +111,6 @@
///
@property (nonatomic,strong) NSMutableSet<NetImageView *> * giftVisibleArray;
///
@property (nonatomic,assign) BOOL isLargeGiftAnimating;
#pragma mark -
@@ -140,9 +137,6 @@
#pragma mark -
@property (nonatomic,strong) SVGAImageView *wishGiftEffectView;
/// PresentAchieveAbstractMatrix
@property(nonatomic,strong) NSMutableArray<GiftReceiveInfoModel *> *animationListA;
/// YUMIPresentBigCaptureMatrix
@@ -155,6 +149,8 @@
//@property(nonatomic,assign) BOOL isAnimationListAFinish;
@property(nonatomic,strong) NSMutableArray *svgaQueue;
@property(nonatomic,assign) CGFloat broadCastHieght;
@property (nonatomic, strong) NetImageView *imageLoader;
@end
@implementation XPRoomAnimationView
@@ -393,12 +389,13 @@
CGFloat top = self.isPlayOfA == YES ? (self.broadCastHieght + statusbarHeight) : (kNavigationHeight + 15);
PIUniversalBannerModel *model = [PIUniversalBannerModel modelWithDictionary:attacment.data];
BOOL isSvga = [model.resourceType isEqualToString:@"SVGA"];
BOOL isSvga = [model.resourceType.uppercaseString isEqualToString:@"SVGA"];
__block PIUniversalBannerView *bannerView;
@kWeakify(self);
if (isSvga == YES) {
SVGAParser *parser = [SVGAParser new];
[parser parseWithURL:[NSURL URLWithString:model.resourceContent] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
@kStrongify(self);
model.videoItem = videoItem;
CGFloat height = kGetScaleWidth(60);
if(videoItem.videoSize.width > 0){
@@ -407,6 +404,7 @@
bannerView = [[PIUniversalBannerView alloc]initWithFrame:CGRectMake(KScreenWidth, top, KScreenWidth, height)];
[self showGeneralFloatingScreenView:bannerView model:model];
} failureBlock:^(NSError * _Nonnull error) {
@kStrongify(self);
[bannerView removeFromSuperview];
self.isPlayOfB = NO;
if(self.animationListB.count > 0){
@@ -415,9 +413,12 @@
[self playAnimationWithModel];
}];
}else{
NetImageView *imageView = [NetImageView new];
[imageView loadImageWithUrl:model.resourceContent completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) {
if (!_imageLoader) {
_imageLoader = [[NetImageView alloc] init];
}
[self.imageLoader loadImageWithUrl:model.resourceContent
completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) {
@kStrongify(self);
model.image = image;
CGFloat width = image.size.width <= 0 ? kGetScaleWidth(60) : image.size.width;
CGFloat height = image.size.height ;
@@ -427,8 +428,10 @@
}
bannerView = [[PIUniversalBannerView alloc]initWithFrame:CGRectMake(KScreenWidth, top, KScreenWidth, getHeight) ];
[self showGeneralFloatingScreenView:bannerView model:model];
}fail:^(NSError * _Nonnull error) {
}
fail:^(NSError * _Nonnull error) {
@kStrongify(self);
[bannerView removeFromSuperview];
self.isPlayOfB = NO;
if(self.animationListB.count > 0){
@@ -436,9 +439,7 @@
}
[self playAnimationWithModel];
}];
}
}
-(void)showGeneralFloatingScreenView:(PIUniversalBannerView *)bannerView model:(PIUniversalBannerModel *)model{
BOOL isSvga = [model.resourceType isEqualToString:@"SVGA"];