Files
featherVoice/QXLive/Room(房间)/View/麦位视图/QXRoomSeatContentView.m
2026-01-14 20:36:58 +08:00

658 lines
23 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// QXRoomSeatContentView.m
// QXLive
//
// Created by 启星 on 2025/6/7.
//
#import "QXRoomSeatContentView.h"
#import "QXSeatHeaderView.h"
#import "QXEffectSvgaView.h"
#import "UIView+VAP.h"
#import "QXFileManager.h"
#import <AgoraRtcKit/AgoraRtcEngineKit.h>
@interface QXRoomSeatContentView()
/// 头像
//@property (nonatomic,strong)UIView *headerContentView;
@property (nonatomic,strong)QXSeatHeaderView *headerView;
@property (nonatomic,strong)UIImageView *lockImageView;
@property (nonatomic,strong)UIImageView *muteImageView;
@property (nonatomic,strong)UIImageView *offlineImageView;
/// 嘉宾 / 主持 标记
@property (nonatomic,strong)UILabel *tagLabel;
///
@property (nonatomic,strong)UILabel *nameLabel;
/// 魅力背景
@property (nonatomic,strong)UIView *charmBgView;
/// 魅力图标
@property (nonatomic,strong)UIImageView *charmIcon;
/// 魅力num
@property (nonatomic,strong)UILabel *charmLabel;
/// 麦位序号
@property (nonatomic,strong)UILabel *numberLabel;
@property (nonatomic,strong) QXEffectSvgaView *micSvgaView;
@property (nonatomic,strong) VAPView *micMp4View;
@property (nonatomic,strong)UIButton *headerBtn;
@property (nonatomic,assign)BOOL isCycleAnimation;
@end
@implementation QXRoomSeatContentView
- (instancetype)init
{
self = [super init];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(speakInfo:) name:noticeUserSpeak object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onlineStatusDidChanged:) name:noticeRoomUserOnlineStatusDidChanged object:nil];
self.clipsToBounds = NO;
[self addSubview:self.noUserImageView];
[self.noUserImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.left.equalTo(self).offset(5);
make.right.equalTo(self).offset(-5);
make.height.equalTo(self.noUserImageView.mas_width);
}];
self.lockImageView.hidden = YES;
[self addSubview:self.lockImageView];
[self.lockImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.height.equalTo(self.noUserImageView);
}];
[self addSubview:self.headerView];
[self.headerView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.left.equalTo(self).offset(5);
make.right.equalTo(self).offset(-5);
make.height.equalTo(self.noUserImageView.mas_width);
}];
[self insertSubview:self.micSvgaView aboveSubview:self.headerView];
[self.micSvgaView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.top.equalTo(self.headerView).offset(-10);
make.right.bottom.equalTo(self.headerView).offset(10);
}];
[self addSubview:self.micMp4View];
[self.micMp4View mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.top.equalTo(self.headerView).offset(-8);
make.right.bottom.equalTo(self.headerView).offset(8);
}];
self.muteImageView.hidden = YES;
[self addSubview:self.muteImageView];
[self.muteImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.height.equalTo(self.noUserImageView);
}];
self.offlineImageView.hidden = YES;
[self addSubview:self.offlineImageView];
[self.offlineImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.height.equalTo(self.noUserImageView);
}];
self.tagLabel = [[UILabel alloc] init];
self.tagLabel.textColor = [UIColor whiteColor];
self.tagLabel.backgroundColor = RGB16(0xC134EE);
self.tagLabel.textAlignment = NSTextAlignmentCenter;
self.tagLabel.font = [UIFont systemFontOfSize:ScaleWidth(10.0)];
[self.tagLabel addRoundedCornersWithRadius:ScaleWidth(6.5)];
self.tagLabel.hidden = YES;
[self addSubview:self.tagLabel];
[self.tagLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
// make.left.right.equalTo(self);
make.centerX.equalTo(self.noUserImageView);
make.top.equalTo(self.noUserImageView.mas_bottom).offset(-8);
make.height.mas_equalTo(ScaleWidth(13));
}];
self.nameLabel = [[UILabel alloc] init];
self.nameLabel.textColor = [UIColor whiteColor];
self.nameLabel.font = [UIFont systemFontOfSize:ScaleWidth(12.0)];
self.nameLabel.text = @"张三李四";
self.nameLabel.lineBreakMode = NSLineBreakByClipping;
self.nameLabel.textAlignment = NSTextAlignmentCenter;
// self.nameLabel.adjustsFontSizeToFitWidth = YES;
self.nameLabel.hidden = YES;
[self addSubview:self.nameLabel];
[self.nameLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.noUserImageView.mas_bottom).offset(5);
// make.centerX.equalTo(self.noUserImageView);
make.height.mas_equalTo(18);
make.left.right.equalTo(self);
}];
self.numberLabel = [[UILabel alloc] init];
self.numberLabel.textColor = RGB16(0xffffff);
self.numberLabel.font = [UIFont systemFontOfSize:ScaleWidth(12.0)];
self.numberLabel.text = @"";
[self addSubview:self.numberLabel];
[self.numberLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.noUserImageView.mas_bottom).offset(5);
make.centerX.equalTo(self.noUserImageView);
make.height.mas_equalTo(18);
}];
MJWeakSelf
self.charmBgView = [[UIView alloc] init];
[self.charmBgView addTapBlock:^(id _Nonnull obj) {
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(previewRoomUserCharmListWithUserId:)]) {
[weakSelf.delegate previewRoomUserCharmListWithUserId:weakSelf.pitModel.user_id];
}
}];
self.charmBgView.backgroundColor = RGB16A(0xffffff, 0.2);
[self.charmBgView addRoundedCornersWithRadius:ScaleWidth(7.5)];
self.charmBgView.hidden = YES;
[self addSubview:self.charmBgView];
[self.charmBgView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self);
make.top.equalTo(self.nameLabel.mas_bottom).offset(3);
make.height.mas_equalTo(ScaleWidth(15));
}];
self.charmIcon = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_seat_charm"]];
[self.charmBgView addSubview:self.charmIcon];
[self.charmIcon mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(5);
make.size.mas_equalTo(CGSizeMake(14, 14));
make.centerY.equalTo(self.charmBgView).offset(-1);
}];
self.charmLabel = [[UILabel alloc] init];
self.charmLabel.textColor = [UIColor whiteColor];
self.charmLabel.text = @"0";
self.charmLabel.font = [UIFont systemFontOfSize:ScaleWidth(10.0)];
[self.charmBgView addSubview:self.charmLabel];
[self.charmLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
// make.left.equalTo(self.charmIcon.mas_right).offset(1);
make.centerY.equalTo(self.charmBgView);
make.centerX.equalTo(self.charmBgView).offset(7);
}];
self.headerBtn = [[UIButton alloc] init];
[self.headerBtn addTarget:self action:@selector(headerAction) forControlEvents:(UIControlEventTouchUpInside)];
[self addSubview:self.headerBtn];
[self.headerBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.noUserImageView);
}];
}
-(void)headerAction{
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:seatView:)]) {
[self.delegate didClickUserHeaderWithPitModel:self.pitModel seatView:self];
}
}
-(void)onlineStatusDidChanged:(NSNotification*)notice{
if (self.noOffLine) {
return;
}
NSDictionary *parm = notice.object;
NSString *uid = [NSString stringWithFormat:@"%@",[parm objectForKey:@"user_id"]];
NSInteger isOnline = [[parm objectForKey:@"is_online"] integerValue];
[QXGlobal.shareGlobal.offLineDict setObject:[NSString stringWithFormat:@"%ld",isOnline] forKey:uid];
if ([uid isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
self.offlineImageView.hidden = YES;
}else{
if ([uid isEqualToString:self.pitModel.user_id]) {
if (isOnline==1) {
self.offlineImageView.hidden = YES;
}else{
self.offlineImageView.hidden = NO;
[self stopAudioAnimation];
}
}
}
QXLOG(@"在线状态%@",QXGlobal.shareGlobal.offLineDict);
NSInteger is_offline = [[[QXGlobal shareGlobal].offLineDict objectForKey:self.pitModel.user_id?self.pitModel.user_id:@"0"] integerValue];
if (is_offline==1) {
self.offlineImageView.hidden = YES;
}else if(is_offline == 2){
if (self.noOffLine) {
self.offlineImageView.hidden = YES;
}else{
self.offlineImageView.hidden = NO;
}
}else{
self.offlineImageView.hidden = YES;
}
}
-(void)speakInfo:(NSNotification*)notice{
if (self.noMicCycle) {
return;
}
id object = notice.object;
if ([object isKindOfClass:[AgoraRtcAudioVolumeInfo class]]) {
AgoraRtcAudioVolumeInfo *info = (AgoraRtcAudioVolumeInfo*)object;
if (info.uid == 0) {
info.uid = [QXGlobal shareGlobal].loginModel.user_id.longLongValue;
}
if ((info.uid == self.pitModel.user_id.longLongValue)) {
if (info.volume > 0) {
self.offlineImageView.hidden = YES;
[QXGlobal.shareGlobal.offLineDict setObject:[NSNumber numberWithBool:NO] forKey:[NSString stringWithFormat:@"%ld",info.uid]];
[self startAudioAnimation];
}else{
[self stopAudioAnimation];
}
}
}
if (self.pitModel.user_id.longLongValue <= 0) {
[self stopAudioAnimation];
}
}
-(void)setNoOffLine:(BOOL)noOffLine{
_noOffLine = noOffLine;
}
-(void)setNoMicCycle:(BOOL)noMicCycle{
_noMicCycle = noMicCycle;
}
-(void)setIsPK:(BOOL)isPK{
_isPK = isPK;
self.nameLabel.font = [UIFont systemFontOfSize:10];
self.numberLabel.font = [UIFont systemFontOfSize:10];
self.charmLabel.font = [UIFont systemFontOfSize:8];
[self.nameLabel mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(ScaleWidth(15));
}];
[self.numberLabel mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(ScaleWidth(15));
}];
[self.charmBgView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(ScaleWidth(12));
make.top.equalTo(self.nameLabel.mas_bottom).offset(1);
}];
[self.charmBgView addRoundedCornersWithRadius:ScaleWidth(6)];
}
/// 开启麦位动画
- (void)startAudioAnimation {
if (self.isSeatSpeaking == YES) {
return;
}
self.isSeatSpeaking = YES;
[self.micSvgaView setHidden:NO];
if ([self.pitModel.mic_cycle isExist]) {
[self.micSvgaView loadSVGAPlayerWith:self.pitModel.mic_cycle inBundle:NO loop:10000000];
}else{
[self.micSvgaView loadSVGAPlayerWith:@"mic" inBundle:YES loop:10000000];
}
[self.micSvgaView startEffectSvgaPlay];
}
/// 暂停麦位动画
- (void)stopAudioAnimation {
if (self.isSeatSpeaking == NO) {
return;
}
self.isSeatSpeaking = NO;
[self.micSvgaView setHidden:YES];
[self.micSvgaView pauseEffectSvgaPlay];
}
-(void)setTagString:(NSString *)tagString{
_tagString = tagString;
if ([tagString isExist]) {
self.tagLabel.hidden = NO;
self.numberLabel.hidden = YES;
self.tagLabel.text = tagString;
[self.tagLabel sizeToFit];
[self.tagLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.noUserImageView);
make.top.equalTo(self.noUserImageView.mas_bottom).offset(-8);
make.height.mas_equalTo(ScaleWidth(13));
make.width.mas_equalTo(self.tagLabel.width+16);
}];
}else{
self.tagLabel.hidden = YES;
}
}
-(void)setType:(QXRoomSeatContentViewType)type{
_type = type;
switch (type) {
case QXRoomSeatContentViewTypeNormal:{
}
break;
case QXRoomSeatContentViewTypeAuction:{
[self.noUserImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.left.equalTo(self).offset(5);
make.bottom.equalTo(self).offset(-5);
make.width.equalTo(self.noUserImageView.mas_height);
}];
[self.headerView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.bottom.equalTo(self.noUserImageView);
}];
[self.nameLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.noUserImageView.mas_right).offset(2);
make.right.equalTo(self);
make.height.mas_equalTo(18);
make.centerY.equalTo(self.noUserImageView);
}];
[self.numberLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.noUserImageView.mas_right).offset(2);
make.right.equalTo(self);
make.height.mas_equalTo(18);
make.centerY.equalTo(self.noUserImageView);
}];
}
break;
case QXRoomSeatContentViewTypeFriend:{
self.charmBgView.backgroundColor = RGB16A(0x000000,0.65);
// self.charmBgView.hidden = NO;
[self.charmBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self);
make.top.equalTo(self.noUserImageView.mas_bottom).offset(-8);
make.height.mas_equalTo(ScaleWidth(15));
}];
[self.nameLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.charmBgView.mas_bottom).offset(0);
// make.centerX.equalTo(self.noUserImageView);
make.height.mas_equalTo(18);
make.left.right.equalTo(self);
}];
self.nameLabel.textColor = RGB16(0xEFEAFF);
self.numberLabel.textColor = RGB16(0xEFEAFF);
[self.numberLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.charmBgView.mas_bottom).offset(0);
make.centerX.equalTo(self.noUserImageView);
make.height.mas_equalTo(18);
}];
}
break;
default:
break;
}
}
-(void)setNumber:(NSInteger)number{
_number = number;
if (number>8) {
return;
}
self.numberLabel.text = [NSString localizedStringWithFormat:QXText(@"%@号麦"),[NSString stringWithFormat:@"%ld",number]];
}
-(void)setOnlyShowHeader:(BOOL)onlyShowHeader{
_onlyShowHeader = onlyShowHeader;
self.charmBgView.hidden = onlyShowHeader;
self.nameLabel.font = onlyShowHeader?[UIFont systemFontOfSize:10]:[UIFont systemFontOfSize:ScaleWidth(12.0)];;
}
-(void)setPitModel:(QXRoomPitModel *)pitModel{
_pitModel = pitModel;
if (pitModel.is_lock.intValue == 1) {
self.lockImageView.hidden = NO;
}else{
self.lockImageView.hidden = YES;
}
if (pitModel.user_id.longValue > 0) {
NSInteger is_offline = [[[QXGlobal shareGlobal].offLineDict objectForKey:pitModel.user_id?pitModel.user_id:@"0"] integerValue];
if (is_offline==1) {
self.offlineImageView.hidden = YES;
}else if(is_offline == 2){
if (self.noOffLine) {
self.offlineImageView.hidden = YES;
}else{
self.offlineImageView.hidden = NO;
}
}else{
self.offlineImageView.hidden = YES;
}
if ([pitModel.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
self.offlineImageView.hidden = YES;
}
self.numberLabel.hidden = YES;
self.headerView.hidden = NO;
self.nameLabel.hidden = NO;
[self.headerView setHeadIcon:pitModel.avatar dress:pitModel.dress];
self.nameLabel.text = pitModel.nickname;
if (self.onlyShowHeader) {
self.charmBgView.hidden = YES;
}else{
self.charmBgView.hidden = NO;
}
self.charmLabel.text = [NSString qx_showHotCountNum:pitModel.charm.longLongValue];
// if (pitModel.is_mute.intValue == 1) {
// self.muteImageView.hidden = NO;
// }else{
// self.muteImageView.hidden = YES;
// }
}else{
self.noUserImageView.hidden = NO;
self.offlineImageView.hidden = YES;
self.numberLabel.hidden = NO;
self.headerView.hidden = YES;
self.nameLabel.hidden = YES;
self.charmBgView.hidden = YES;
// if (pitModel.is_mute.intValue == 1) {
// self.muteImageView.hidden = YES;
// }else{
// self.muteImageView.hidden = YES;
// }
}
if (self.type == QXRoomSeatContentViewTypeAuction) {
self.charmBgView.hidden = YES;
}
}
-(void)updateUserCharm:(NSString *)charm{
self.pitModel.charm = charm;
self.charmLabel.text = [NSString qx_showHotCountNum:self.pitModel.charm.longLongValue];
}
-(void)hideCharm{
self.charmBgView.hidden = YES;
}
//-(void)setUserModel:(QXRoomOwnerModel *)userModel{
// _userModel = userModel;
// self.noUserImageView.hidden = YES;
// self.numberLabel.hidden = YES;
// self.headerView.hidden = NO;
// self.nameLabel.hidden = NO;
//
// [self.headerView setHeadIcon:userModel.avatar dress:userModel.dress];
// self.nameLabel.text = userModel.nickname;
// self.charmBgView.hidden = NO;
// self.charmLabel.text = [NSString qx_showHotCountNum:userModel.charm.longLongValue];
//}
-(void)setIs_lock:(NSString *)is_lock{
_is_lock = is_lock;
self.pitModel.is_lock = is_lock;
if (self.pitModel.is_lock.intValue == 1) {
self.lockImageView.hidden = NO;
}else{
self.lockImageView.hidden = YES;
}
}
-(void)hideName{
self.numberLabel.hidden = YES;
self.nameLabel.hidden = YES;
}
-(void)setIsAutionSeat:(BOOL)isAutionSeat{
_isAutionSeat = isAutionSeat;
self.noUserImageView.image = [UIImage imageNamed:@"room_seat_auction_icon"];
self.charmBgView.hidden = YES;
}
-(void)setTagViewBgColor:(NSString *)tagViewBgColor{
_tagViewBgColor = tagViewBgColor;
self.tagLabel.backgroundColor = [UIColor colorWithHexString:tagViewBgColor];
}
-(void)setNameToHeaderSpace:(CGFloat)nameToHeaderSpace{
_nameToHeaderSpace = nameToHeaderSpace;
[self.nameLabel mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.noUserImageView.mas_bottom).offset(nameToHeaderSpace);
}];
}
-(void)setCharmToNameSpace:(CGFloat)charmToNameSpace{
_charmToNameSpace = charmToNameSpace;
[self.charmBgView mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.nameLabel.mas_bottom).offset(charmToNameSpace);
}];
}
-(void)setNameFontSize:(CGFloat)nameFontSize{
self.nameLabel.font = [UIFont systemFontOfSize:nameFontSize];
}
-(void)setNameBeyound:(BOOL)nameBeyound{
_nameBeyound = nameBeyound;
if (nameBeyound) {
[self.nameLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.noUserImageView.mas_bottom).offset(self.nameToHeaderSpace);
make.centerX.equalTo(self.noUserImageView);
make.height.mas_equalTo(18);
}];
}else{
[self.nameLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.noUserImageView.mas_bottom).offset(5);
make.height.mas_equalTo(18);
make.left.right.equalTo(self);
}];
}
}
-(void)startCycleAnimation{
if (self.isCycleAnimation == YES) {
return;
}
CABasicAnimation* rotationAnimation;
//绕哪个轴那么就改成什么这里是绕y轴 ---> transform.rotation.y
rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
//旋转角度
rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI];
//每次旋转的时间(单位秒)
rotationAnimation.duration = 2;
rotationAnimation.cumulative = YES;
rotationAnimation.removedOnCompletion = NO;
//重复旋转的次数如果你想要无数次那么设置成MAXFLOAT
rotationAnimation.repeatCount = MAXFLOAT;
[self.headerView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];
}
-(void)stopCycleAnimation{
self.isCycleAnimation = NO;
[self.headerView.layer removeAllAnimations];
}
-(void)setNumberString:(NSString *)numberString{
self.numberLabel.text = numberString;
}
//-(void)setSinger:(QXSongListModel *)singer{
// _singer = singer;
// self.noUserImageView.hidden = YES;
// self.numberLabel.hidden = YES;
// self.headerView.hidden = NO;
// self.nameLabel.hidden = NO;
//
// [self.headerView setHeadIcon:singer.avatar dress:singer.dress];
// self.nameLabel.text = singer.nickname;
// self.charmBgView.hidden = NO;
// self.charmLabel.text = [NSString qx_showHotCountNum:singer.charm.longLongValue];
//}
-(QXSeatHeaderView *)headerView{
if (!_headerView) {
_headerView = [[QXSeatHeaderView alloc] init];
_headerView.hidden = YES;
}
return _headerView;
}
-(UIImageView *)noUserImageView{
if (!_noUserImageView) {
UIImage *image = [UIImage imageNamed:@"room_seat_icon"];
// image = [image imageByTintColor:QXConfig.themeColor];
_noUserImageView = [[UIImageView alloc] initWithImage:image];
}
return _noUserImageView;
}
-(UIImageView *)offlineImageView{
if (!_offlineImageView) {
UIImage *image = [UIImage imageNamed:@"room_user_offline"];
// image = [image imageByTintColor:QXConfig.themeColor];
_offlineImageView = [[UIImageView alloc] initWithImage:image];
_offlineImageView.contentMode = UIViewContentModeScaleToFill;
_offlineImageView.hidden = YES;
}
return _offlineImageView;
}
-(UIImageView *)lockImageView{
if (!_lockImageView) {
_lockImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_seat_lock"]];
}
return _lockImageView;
}
-(UIImageView *)muteImageView{
if (!_muteImageView) {
_muteImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_seat_mute"]];
}
return _muteImageView;
}
- (QXEffectSvgaView *)micSvgaView {
if (!_micSvgaView) {
_micSvgaView = [[QXEffectSvgaView alloc] initWithFrame:CGRectZero isAutoPlay:YES];
_micSvgaView.hidden = YES;
__weak typeof(self)weakSelf = self;
_micSvgaView.didFinishedDisplay = ^(QXEffectSvgaView * _Nonnull svgaView) {
weakSelf.isSeatSpeaking = NO;
};
}
return _micSvgaView;
}
- (VAPView *)micMp4View {
if (!_micMp4View) {
_micMp4View = [[VAPView alloc] initWithFrame:CGRectZero];
_micMp4View.hwd_enterBackgroundOP = HWDMP4EBOperationTypePauseAndResume;
_micMp4View.contentMode = UIViewContentModeScaleAspectFit;
_micMp4View.userInteractionEnabled = NO;
_micMp4View.backgroundColor = [UIColor clearColor];
_micMp4View.hidden = YES;
}
return _micMp4View;
}
-(void)destroyViews{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[self.micMp4View stopHWDMP4];
[self.micMp4View removeFromSuperview];
self.micMp4View = nil;
[self.micSvgaView destroySvga];
}
-(void)stopHWDMP4{
[self.headerView stopHWDMP4];
}
-(void)playHWDMP4{
[self.headerView playHWDMP4];
}
@end