移除 A/B 相关代码。
通过 [ClientConfig shareConfig].canOpen 控制页面,现在已没有相关配置,删除/调整相关内容,[ClientConfig shareConfig].canOpen == YES 的部分将保留等价逻辑/代码
This commit is contained in:
@@ -232,9 +232,6 @@
|
||||
#pragma mark - NIMBroadcastDelegate
|
||||
// 广播消息
|
||||
- (void)onReceiveBroadcastMessage:(NIMBroadcastMessage *)broadcastMessage{
|
||||
if (![ClientConfig shareConfig].canOpen) {
|
||||
return;
|
||||
}
|
||||
if (broadcastMessage.content) {
|
||||
NSDictionary *msgDictionary = [broadcastMessage.content toJSONObject];
|
||||
AttachmentModel *attachment = [AttachmentModel modelWithJSON:msgDictionary[@"body"]];
|
||||
@@ -268,21 +265,6 @@
|
||||
- (void)handleNIMCustomMessage:(NIMMessage *)message {
|
||||
NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;
|
||||
if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) {
|
||||
if (![ClientConfig shareConfig].canOpen) {
|
||||
AttachmentModel *attachment = (AttachmentModel *)obj.attachment;
|
||||
if (attachment.first == CustomMessageType_Gift) {
|
||||
GiftReceiveInfoModel * receiveInfo = [GiftReceiveInfoModel modelWithJSON:attachment.data];
|
||||
receiveInfo.isLuckyBagGift = attachment.second == Custom_Message_Sub_Gift_LuckySend;
|
||||
receiveInfo.isBatch = YES;
|
||||
[self receiveGiftHandleSendGiftAnimation:attachment];
|
||||
} else if (attachment.first == CustomMessageType_AllMicroSend) { //发送全麦礼物 或者多人礼物
|
||||
GiftReceiveInfoModel * receiveInfo = [GiftReceiveInfoModel modelWithJSON:attachment.data];
|
||||
receiveInfo.isLuckyBagGift = (attachment.second == Custom_Message_Sub_AllMicroLuckySend || attachment.second == Custom_Message_Sub_AllBatchMicroLuckySend);
|
||||
receiveInfo.isBatch = (attachment.second == Custom_Message_Sub_AllBatchSend || attachment.second == Custom_Message_Sub_AllBatchMicroLuckySend);
|
||||
[self receiveGiftHandleSendGiftAnimation:attachment];
|
||||
}
|
||||
return;
|
||||
}
|
||||
AttachmentModel *attachment = (AttachmentModel *)obj.attachment;
|
||||
if (attachment.first == CustomMessageType_Gift) {
|
||||
GiftReceiveInfoModel * receiveInfo = [GiftReceiveInfoModel modelWithJSON:attachment.data];
|
||||
@@ -2058,9 +2040,49 @@
|
||||
NSString *fullPath = [filePath stringByAppendingPathComponent:fileName];
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:fullPath]){
|
||||
NSData *data = [NSData dataWithContentsOfFile:fullPath options:0 error:NULL];
|
||||
@kWeakify(self);
|
||||
[self.parser parseWithData:data cacheKey:nil completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
@kStrongify(self);
|
||||
if (videoItem != nil) {
|
||||
self.giftEffectView.hidden = NO;
|
||||
if (self.giftEffectView.superview == nil) {
|
||||
[self.middleLevelView addSubview:self.giftEffectView];
|
||||
[self.giftEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self.middleLevelView);
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.height.mas_equalTo(KScreenHeight);
|
||||
}];
|
||||
}
|
||||
CGFloat width = videoItem.videoSize.width;
|
||||
CGFloat height = videoItem.videoSize.height;
|
||||
if (width > height) {
|
||||
self.giftEffectView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
} else {//高大于宽
|
||||
CGFloat resizeH = KScreenWidth * height / width;//按照屏幕的宽度去缩放,获得高度
|
||||
if (resizeH > KScreenHeight) {//如果大于屏幕高度,填充
|
||||
self.giftEffectView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
} else {//小于屏幕高度,
|
||||
self.giftEffectView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
}
|
||||
self.giftEffectView.alpha = 1;
|
||||
self.giftEffectView.loops = 1;
|
||||
self.giftEffectView.clearsAfterStop = YES;
|
||||
self.giftEffectView.videoItem = videoItem;
|
||||
[self.giftEffectView startAnimation];
|
||||
} else {
|
||||
self.isLargeGiftAnimating = NO;
|
||||
}
|
||||
} failureBlock:^(NSError * _Nonnull error) {
|
||||
@kStrongify(self);
|
||||
self.giftEffectView.hidden = YES;
|
||||
self.isLargeGiftAnimating = NO;
|
||||
}];
|
||||
} else {
|
||||
@kWeakify(self);
|
||||
[self.parser parseWithURL:[NSURL URLWithString:encodingUrl] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) {
|
||||
@kStrongify(self);
|
||||
if (videoItem != nil) {
|
||||
|
||||
self.giftEffectView.hidden = NO;
|
||||
if (self.giftEffectView.superview == nil) {
|
||||
[self.middleLevelView addSubview:self.giftEffectView];
|
||||
@@ -2090,50 +2112,12 @@
|
||||
return;
|
||||
}
|
||||
self.isLargeGiftAnimating = NO;
|
||||
} failureBlock:^(NSError * _Nonnull error) {
|
||||
} failureBlock:^(NSError * _Nullable error) {
|
||||
@kStrongify(self);
|
||||
self.giftEffectView.hidden = YES;
|
||||
self.isLargeGiftAnimating = NO;
|
||||
}];
|
||||
return;
|
||||
|
||||
};
|
||||
|
||||
[self.parser parseWithURL:[NSURL URLWithString:encodingUrl] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) {
|
||||
if (videoItem != nil) {
|
||||
|
||||
self.giftEffectView.hidden = NO;
|
||||
if (self.giftEffectView.superview == nil) {
|
||||
[self.middleLevelView addSubview:self.giftEffectView];
|
||||
[self.giftEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self.middleLevelView);
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.height.mas_equalTo(KScreenHeight);
|
||||
}];
|
||||
}
|
||||
CGFloat width = videoItem.videoSize.width;
|
||||
CGFloat height = videoItem.videoSize.height;
|
||||
if (width > height) {
|
||||
self.giftEffectView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
} else {//高大于宽
|
||||
CGFloat resizeH = KScreenWidth * height / width;//按照屏幕的宽度去缩放,获得高度
|
||||
if (resizeH > KScreenHeight) {//如果大于屏幕高度,填充
|
||||
self.giftEffectView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
} else {//小于屏幕高度,
|
||||
self.giftEffectView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
}
|
||||
self.giftEffectView.alpha = 1;
|
||||
self.giftEffectView.loops = 1;
|
||||
self.giftEffectView.clearsAfterStop = YES;
|
||||
self.giftEffectView.videoItem = videoItem;
|
||||
[self.giftEffectView startAnimation];
|
||||
return;
|
||||
}
|
||||
self.isLargeGiftAnimating = NO;
|
||||
} failureBlock:^(NSError * _Nullable error) {
|
||||
self.giftEffectView.hidden = YES;
|
||||
self.isLargeGiftAnimating = NO;
|
||||
}];
|
||||
}
|
||||
}
|
||||
///播放礼物特效 pag的
|
||||
- (void)playGiftEffectWithPagUrl:(NSString *)pagUrl {
|
||||
|
Reference in New Issue
Block a user