最后调整
This commit is contained in:
@@ -29,7 +29,8 @@
|
||||
}
|
||||
-(void)initSubViews{
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
self.titles = @[@"房间榜", @"财富榜", @"魅力榜",@"公会榜",@"真爱榜"];
|
||||
// self.titles = @[@"房间榜", @"财富榜", @"魅力榜",@"公会榜",@"真爱榜"];
|
||||
self.titles = @[@"房间榜", @"财富榜", @"魅力榜",@"真爱榜"];
|
||||
self.listVCArray = [NSMutableArray array];
|
||||
self.categoryView = [[JXCategoryTitleView alloc] init];
|
||||
self.categoryView.frame = CGRectMake(0, 0, SCREEN_WIDTH-100, 44);
|
||||
@@ -39,10 +40,10 @@
|
||||
self.categoryView.titleColor = [UIColor colorWithHexString:@"#999999"];
|
||||
JXCategoryIndicatorImageView *indicatorImageView = [[JXCategoryIndicatorImageView alloc] init];
|
||||
indicatorImageView.indicatorImageView.image = [UIImage imageNamed:@"home_slider"];
|
||||
indicatorImageView.indicatorWidth = (SCREEN_WIDTH-100)/5.0;
|
||||
indicatorImageView.indicatorWidth = (SCREEN_WIDTH-100)/self.titles.count;
|
||||
indicatorImageView.indicatorHeight = 5;
|
||||
self.categoryView.indicators = @[indicatorImageView];
|
||||
self.categoryView.cellWidth = (SCREEN_WIDTH-100)/5.0;
|
||||
self.categoryView.cellWidth = (SCREEN_WIDTH-100)/self.titles.count;
|
||||
self.categoryView.contentEdgeInsetLeft = 0;
|
||||
self.categoryView.cellSpacing = 0;
|
||||
self.categoryView.titleLabelZoomScale = 1.1;
|
||||
@@ -61,7 +62,11 @@
|
||||
}
|
||||
-(id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
|
||||
QXRankHomeSubVC *vc = [[QXRankHomeSubVC alloc] init];
|
||||
vc.rankType = index;
|
||||
if (index == 3) {
|
||||
vc.rankType = 4;
|
||||
}else{
|
||||
vc.rankType = index;
|
||||
}
|
||||
return vc;
|
||||
}
|
||||
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
|
||||
|
||||
@@ -541,6 +541,8 @@ QXRoomUserInfoViewDelegate
|
||||
if (self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4){
|
||||
hasSong = YES;
|
||||
}
|
||||
/// 暂时不要pk
|
||||
hasPK = NO;
|
||||
/// 普通麦位
|
||||
if (self.seatContentView.myPitNumber <= 0) {
|
||||
self.bottomView.status = 1;
|
||||
@@ -1234,6 +1236,9 @@ QXRoomUserInfoViewDelegate
|
||||
}
|
||||
if (md.pit_number.intValue == 9) {
|
||||
compereModel = md;
|
||||
if (md.user_id.longValue > 0 && ![md.user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
|
||||
[pitArr insertObject:md atIndex:0];
|
||||
}
|
||||
continue;
|
||||
}else if (md.pit_number.intValue == 10) {
|
||||
guestModel = md;
|
||||
@@ -1243,6 +1248,7 @@ QXRoomUserInfoViewDelegate
|
||||
[pitArr addObject:md];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// k歌麦位
|
||||
@@ -1604,13 +1610,14 @@ QXRoomUserInfoViewDelegate
|
||||
_sendGiftView.roomId = self.roomId;
|
||||
// [_sendGiftView reloadData];
|
||||
MJWeakSelf
|
||||
_sendGiftView.roomSendSuccessBlock = ^(QXSendGiftViewType sendType, QXGiftModel * _Nonnull giftModel, NSString * _Nonnull userId, NSString * _Nonnull optionId) {
|
||||
_sendGiftView.roomSendSuccessBlock = ^(QXSendGiftViewType sendType, QXGiftModel * _Nonnull giftModel, NSString * _Nonnull giftCount, NSString * _Nonnull userId, NSString * _Nonnull optionId) {
|
||||
// if (self->_continuousView == nil) {
|
||||
[weakSelf.view addSubview:weakSelf.continuousView];
|
||||
// }
|
||||
weakSelf.continuousView.giftModel = giftModel;
|
||||
weakSelf.continuousView.sendType = sendType;
|
||||
weakSelf.continuousView.userId = userId;
|
||||
weakSelf.continuousView.giftCount = giftCount;
|
||||
switch (sendType) {
|
||||
case QXSendGiftViewTypeFriend:{
|
||||
weakSelf.continuousView.heartId = optionId;
|
||||
|
||||
@@ -41,6 +41,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
//@property (nonatomic,strong)QXRoomOwnerModel *userModel ;
|
||||
|
||||
-(void)updateUserCharm:(NSString*)charm;
|
||||
|
||||
- (void)startAudioAnimation ;
|
||||
/// 暂停麦位动画
|
||||
- (void)stopAudioAnimation ;
|
||||
|
||||
@@ -79,10 +79,10 @@
|
||||
make.height.equalTo(self.noUserImageView.mas_width);
|
||||
}];
|
||||
|
||||
[self addSubview:self.micSvgaView];
|
||||
[self insertSubview:self.micSvgaView belowSubview:self.headerView];
|
||||
[self.micSvgaView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.top.equalTo(self.headerView).offset(-8);
|
||||
make.right.bottom.equalTo(self.headerView).offset(8);
|
||||
make.left.top.equalTo(self.headerView).offset(-10);
|
||||
make.right.bottom.equalTo(self.headerView).offset(10);
|
||||
}];
|
||||
|
||||
[self addSubview:self.micMp4View];
|
||||
@@ -225,6 +225,9 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
if (self.pitModel.user_id.longLongValue <= 0) {
|
||||
[self stopAudioAnimation];
|
||||
}
|
||||
}
|
||||
-(void)setIsPK:(BOOL)isPK{
|
||||
_isPK = isPK;
|
||||
@@ -388,6 +391,10 @@
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1108,8 +1108,9 @@
|
||||
QXRoomSeatContentView *contentView = (QXRoomSeatContentView *)object;
|
||||
QXRoomPitModel *md = contentView.pitModel;
|
||||
if ([model.user_id isEqualToString:md.user_id]) {
|
||||
md.charm = model.charm;
|
||||
contentView.pitModel = md;
|
||||
// md.charm = model.charm;
|
||||
// contentView.pitModel = md;
|
||||
[contentView updateUserCharm:model.charm];
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1334,6 +1335,16 @@
|
||||
[contentView destroyViews];
|
||||
}
|
||||
}
|
||||
[self.heartTopLinePlayer stopAnimation];
|
||||
_heartTopLinePlayer = nil;
|
||||
[self.heartCenterLinePlayer stopAnimation];
|
||||
_heartCenterLinePlayer = nil;
|
||||
[self.heartBottomLinePlayer stopAnimation];
|
||||
_heartBottomLinePlayer = nil;
|
||||
|
||||
_heartTopLineParser = nil;
|
||||
_heartCenterLineParser = nil;
|
||||
_heartBottomLineParser = nil;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ static NSInteger maxSeat = 8;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number{
|
||||
-(void) didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number{
|
||||
if (pit_number > 10) {
|
||||
return;
|
||||
}
|
||||
@@ -345,8 +345,9 @@ static NSInteger maxSeat = 8;
|
||||
for (QXRoomSeatContentView *seatView in self.seatArray) {
|
||||
QXRoomPitModel *md = seatView.pitModel;
|
||||
if ([model.user_id isEqualToString:md.user_id]) {
|
||||
md.charm = model.charm;
|
||||
seatView.pitModel = md;
|
||||
// md.charm = model.charm;
|
||||
// seatView.pitModel = md;
|
||||
[seatView updateUserCharm:model.charm];
|
||||
// if (self.isPKMyRoom || self.isPKOtherRoom) {
|
||||
// [seatView hideCharm];
|
||||
// }
|
||||
|
||||
@@ -532,19 +532,22 @@ QXRoomSeatDelegate
|
||||
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model{
|
||||
QXRoomPitModel *singerModel = self.singerSeatView.pitModel;
|
||||
if ([singerModel.user_id isEqualToString:model.user_id]) {
|
||||
singerModel.charm = model.charm;
|
||||
self.singerSeatView.pitModel = singerModel;
|
||||
// singerModel.charm = model.charm;
|
||||
// self.singerSeatView.pitModel = singerModel;
|
||||
[self.singerSeatView updateUserCharm:model.charm];
|
||||
}
|
||||
QXRoomPitModel *compereModel = self.compereView.pitModel;
|
||||
if ([compereModel.user_id isEqualToString:model.user_id]) {
|
||||
compereModel.charm = model.charm;
|
||||
self.compereView.pitModel = compereModel;
|
||||
// compereModel.charm = model.charm;
|
||||
// self.compereView.pitModel = compereModel;
|
||||
[self.compereView updateUserCharm:model.charm];
|
||||
return;
|
||||
}
|
||||
QXRoomPitModel *guestModel = self.guestView.pitModel;
|
||||
if ([guestModel.user_id isEqualToString:model.user_id]) {
|
||||
guestModel.charm = model.charm;
|
||||
self.guestView.pitModel = guestModel;
|
||||
// guestModel.charm = model.charm;
|
||||
// self.guestView.pitModel = guestModel;
|
||||
[self.guestView updateUserCharm:model.charm];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
@interface QXRoomSeatView()<QXRoomSeatDelegate>
|
||||
@property (nonatomic,strong)QXRoomSeatTypeNormalView *normalSeatView;
|
||||
|
||||
@property (nonatomic,strong)QXRoomSeatTypeSongView *songView;
|
||||
|
||||
@property (nonatomic,strong)QXRoomSeatTypeAuctionView *auctionView;
|
||||
|
||||
@@ -152,6 +152,7 @@
|
||||
|
||||
#pragma mark - SVGAPlayerDelegate
|
||||
- (void)svgaPlayerDidFinishedAnimation:(SVGAPlayer *)player {
|
||||
[self.player stopAnimation];
|
||||
if (self.didFinishedDisplay) {
|
||||
self.didFinishedDisplay(self);
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (QXEffectContentView *)defaultChatEffectView;
|
||||
|
||||
/// 礼物、坐骑【全屏位置】特效 加载
|
||||
- (void)displayFullEffectView:(QXGiftModel *)gift;
|
||||
- (void)displayFullEffectView:(NSString *)gift;
|
||||
|
||||
/// 坐骑【公屏信息流位置】特效 加载
|
||||
- (void)displayChatEffectView:(QXGiftModel *)gift;
|
||||
- (void)displayChatEffectView:(NSString *)gift;
|
||||
|
||||
/// 关闭打开动效
|
||||
- (void)openOrCloseEffectViewWith:(BOOL)isShow;
|
||||
@@ -37,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@interface QXEffectContentView : UIView
|
||||
@property (nonatomic,strong) VAPView *playerMp4View;
|
||||
@property (nonatomic, strong) dispatch_queue_t queue;
|
||||
- (void)displayEffectView:(QXGiftModel *)gift;
|
||||
- (void)displayEffectView:(NSString *)play_image;
|
||||
- (void)openOrCloseEffectViewWith:(BOOL)isShow;
|
||||
@property (nonatomic,assign) BOOL isShow;
|
||||
- (void)destroyEffectView;
|
||||
|
||||
@@ -8,7 +8,12 @@
|
||||
#import "QXGiftPlayerManager.h"
|
||||
#import "QXEffectSvgaView.h"
|
||||
#import "QXFileManager.h"
|
||||
#import "FMDB.h"
|
||||
static NSString *TABLENAME = @"qxGitfPlayTable";
|
||||
static NSString *ID = @"id";
|
||||
static NSString *PLAY_IMAGE = @"play_image";
|
||||
@interface QXGiftPlayerManager()
|
||||
@property (nonatomic,strong) FMDatabase *fmdb;
|
||||
@property (nonatomic,strong) UIView *bgEffectView;
|
||||
// 礼物、坐骑【全屏位置】特效
|
||||
@property (nonatomic,strong) QXEffectContentView *fullEffectView;
|
||||
@@ -24,9 +29,88 @@
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
manager = [[QXGiftPlayerManager alloc] init];
|
||||
// [manager creatDatabase];
|
||||
});
|
||||
return manager;
|
||||
}
|
||||
//获得存放数据库文件的沙盒地址
|
||||
//- (NSString *)databaseFilePath
|
||||
//{
|
||||
// NSArray *filePath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
// NSString *documentPath = [filePath objectAtIndex:0];
|
||||
// NSString *dbFilePath = [documentPath stringByAppendingPathComponent:@"qx_gift.db"];
|
||||
// return dbFilePath;
|
||||
//}
|
||||
//
|
||||
////创建数据库
|
||||
//- (void)creatDatabase
|
||||
//{
|
||||
// _fmdb = [FMDatabase databaseWithPath:[self databaseFilePath]];
|
||||
// //为数据库设置缓存,提高查询效率
|
||||
// [_fmdb setShouldCacheStatements:YES];
|
||||
// [_fmdb open];
|
||||
// NSString *sqlCreateTable = [NSString stringWithFormat:@"CREATE TABLE IF NOT EXISTS '%@' ('%@' INTEGER PRIMARY KEY AUTOINCREMENT, '%@' TEXT)",TABLENAME,ID,PLAY_IMAGE];
|
||||
// BOOL res = [_fmdb executeUpdate:sqlCreateTable];
|
||||
// NSLog(@"%@",res?@"数据库创建成功":@"数据库创建失败");
|
||||
// [_fmdb close];
|
||||
//}
|
||||
//
|
||||
//-(void)insertGiftWithPlayImage:(NSString*)giftImage{
|
||||
// if ([_fmdb open]) {
|
||||
// NSString *insertSql1= [NSString stringWithFormat:
|
||||
// @"INSERT INTO '%@' ('%@') VALUES ('%@');",
|
||||
// TABLENAME, PLAY_IMAGE, giftImage];
|
||||
// BOOL res = [_fmdb executeUpdate:insertSql1];
|
||||
// NSLog(@"%@",res?@"礼物添加成功":@"礼物添加失败");
|
||||
// [_fmdb close];
|
||||
// }
|
||||
//}
|
||||
//- (BOOL)deleteRecordWithId:(NSInteger)recordId {
|
||||
// if ([_fmdb open]) {
|
||||
// NSString *deleteSQL = [NSString stringWithFormat:
|
||||
// @"DELETE FROM %@ WHERE id = ('%ld');",
|
||||
// TABLENAME, recordId];
|
||||
// BOOL success = [_fmdb executeUpdate:deleteSQL];
|
||||
// if (!success) {
|
||||
// NSLog(@"删除失败: %@", [_fmdb lastErrorMessage]);
|
||||
// }else{
|
||||
// NSLog(@"删除成功");
|
||||
// }
|
||||
// [_fmdb close];
|
||||
// return success;
|
||||
// }
|
||||
// return NO;
|
||||
//}
|
||||
//
|
||||
//-(BOOL)deleFirstImage{
|
||||
// if ([_fmdb open]) {
|
||||
// NSString *querySQL= [NSString stringWithFormat:
|
||||
// @"SELECT id FROM '%@' ORDER BY id ASC LIMIT 1",
|
||||
// TABLENAME];
|
||||
// FMResultSet *resultSet = [_fmdb executeQuery:querySQL];
|
||||
// [_fmdb close];
|
||||
// if ([resultSet next]) {
|
||||
// NSInteger recordId = [resultSet intForColumn:@"id"];
|
||||
// return [self deleteRecordWithId:recordId];
|
||||
// }
|
||||
// }
|
||||
// return NO;
|
||||
//}
|
||||
//
|
||||
//-(NSString*)readFirstImage{
|
||||
// if ([_fmdb open]) {
|
||||
// NSString *querySQL= [NSString stringWithFormat:
|
||||
// @"SELECT id FROM '%@' ORDER BY id ASC LIMIT 1",
|
||||
// TABLENAME];
|
||||
// FMResultSet *resultSet = [_fmdb executeQuery:querySQL];
|
||||
// [_fmdb close];
|
||||
// if ([resultSet next]) {
|
||||
// NSString *playImage = [resultSet stringForColumn:PLAY_IMAGE];
|
||||
// return playImage;
|
||||
// }
|
||||
// }
|
||||
// return nil;
|
||||
//}
|
||||
|
||||
- (UIView *)defaultBgEffectView {
|
||||
return self.bgEffectView;
|
||||
@@ -42,13 +126,14 @@
|
||||
return self.chatEffectView;
|
||||
}
|
||||
|
||||
- (void)displayFullEffectView:(QXGiftModel *)gift {
|
||||
- (void)displayFullEffectView:(NSString *)gift {
|
||||
// [self insertGiftWithPlayImage:gift];
|
||||
[self.fullEffectView displayEffectView:gift];
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (void)displayChatEffectView:(QXGiftModel *)gift {
|
||||
- (void)displayChatEffectView:(NSString *)gift {
|
||||
[self.chatEffectView displayEffectView:gift];
|
||||
}
|
||||
/// 关闭打开动效
|
||||
@@ -126,10 +211,10 @@
|
||||
if (self) {
|
||||
self.userInteractionEnabled = NO;
|
||||
self.isLoadEffect = NO;
|
||||
[self addSubview:self.effectView];
|
||||
[self addSubview:self.svagView];
|
||||
[self addSubview:self.playerMp4View];
|
||||
|
||||
[self.effectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
[self.svagView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
[self.playerMp4View mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -138,19 +223,30 @@
|
||||
}
|
||||
return self;
|
||||
}
|
||||
- (void)displayEffectView:(QXGiftModel *)gift {
|
||||
/// 礼物特效进来 gift为礼物实体类
|
||||
- (void)displayEffectView:(NSString *)play_image {
|
||||
dispatch_async(self.queue, ^{
|
||||
if (![gift.play_image isExist]) {
|
||||
/// 如果play_image不存在return
|
||||
if (![play_image isExist]) {
|
||||
return;
|
||||
}
|
||||
NSString *pathExtension = [gift.play_image pathExtension].lowercaseString;
|
||||
/// 将play_image链接转为小写
|
||||
NSString *pathExtension = [play_image pathExtension].lowercaseString;
|
||||
/// 判定礼物的后缀是否为svga或者mp4如果非这两种 则return
|
||||
if (!([pathExtension isEqualToString:@"svga"] || [pathExtension isEqualToString:@"mp4"])) {
|
||||
return;
|
||||
}
|
||||
/// 锁住list
|
||||
[self.lock lock];
|
||||
[self.giftArray addObject:gift];
|
||||
/// 添加礼物进list
|
||||
[self.giftArray addObject:play_image];
|
||||
NSLog(@"当前礼物有---%ld个",self.giftArray.count);
|
||||
/// 解锁
|
||||
[self.lock unlock];
|
||||
|
||||
/// 如果没有在加载则开始加载
|
||||
if (self.isLoadEffect == NO) {
|
||||
/// 更改加载状态标记
|
||||
self.isLoadEffect = YES;
|
||||
[self loadStartSVGAPlayer];
|
||||
}
|
||||
@@ -160,7 +256,7 @@
|
||||
_isShow = isShow;
|
||||
[self removeSvgaQueueData];
|
||||
|
||||
[self.effectView stopEffectSvgaPlay];
|
||||
[self.svagView stopEffectSvgaPlay];
|
||||
// [self.playerView stop];
|
||||
[self.playerMp4View stopHWDMP4];
|
||||
// [self.alphaVideoView stop];
|
||||
@@ -170,7 +266,7 @@
|
||||
-(void)stopPlay{
|
||||
[self removeSvgaQueueData];
|
||||
|
||||
[self.effectView stopEffectSvgaPlay];
|
||||
[self.svagView stopEffectSvgaPlay];
|
||||
// [self.playerView stop];
|
||||
[self.playerMp4View stopHWDMP4];
|
||||
// [self.alphaVideoView stop];
|
||||
@@ -180,39 +276,54 @@
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
self.playerMp4View.hidden = YES;
|
||||
});
|
||||
[self loadStartSVGAPlayer];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self loadStartSVGAPlayer];
|
||||
});
|
||||
}
|
||||
- (void)loadStartSVGAPlayer {
|
||||
if (!_isShow) {
|
||||
/// isshow 为是否开启特效 如果未开启则return
|
||||
return;
|
||||
}
|
||||
QXGiftModel *giftModel = nil;
|
||||
NSString *play_image = nil;
|
||||
/// list加锁
|
||||
[self.lock lock];
|
||||
/// 如果list长度大于0
|
||||
if (self.giftArray.count > 0) {
|
||||
giftModel = self.giftArray.firstObject;
|
||||
/// gift的实体类则赋值,取list中的第一个数据
|
||||
play_image = self.giftArray.firstObject;
|
||||
/// 移除list的第一条数据
|
||||
[self.giftArray removeObjectAtIndex:0];
|
||||
self.isLoadEffect = YES;
|
||||
}else {
|
||||
self.isLoadEffect = NO;
|
||||
}
|
||||
/// 解锁
|
||||
[self.lock unlock];
|
||||
if (self.isLoadEffect && [giftModel.play_image isExist]) {
|
||||
if (self.isLoadEffect && [play_image isExist]) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if ([giftModel.play_image hasSuffix:@"mp4"]) {
|
||||
if ([play_image hasSuffix:@"mp4"]) {
|
||||
__weak typeof(self)weakSelf = self;
|
||||
[[QXRequset shareInstance] downloadVideoPlayerWithUrl:giftModel.play_image completion:^(BOOL result, NSString * _Nonnull fileName) {
|
||||
/// mp4格式下载播放
|
||||
[[QXRequset shareInstance] downloadVideoPlayerWithUrl:play_image completion:^(BOOL result, NSString * _Nonnull fileName) {
|
||||
NSString *videoPath = [QXFileManager getGiftVideoPath:fileName];
|
||||
weakSelf.playerMp4View.hidden = NO;
|
||||
weakSelf.effectView.hidden = YES;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
weakSelf.playerMp4View.hidden = NO;
|
||||
weakSelf.svagView.hidden = YES;
|
||||
});
|
||||
|
||||
[weakSelf.playerMp4View playHWDMP4:videoPath delegate:self];
|
||||
}];
|
||||
}else if ([giftModel.play_image hasSuffix:@"svg"] || [giftModel.play_image hasSuffix:@"svga"]) {
|
||||
}else if ([play_image hasSuffix:@"svg"] || [play_image hasSuffix:@"svga"]) {
|
||||
__weak typeof(self)weakSelf = self;
|
||||
[[QXRequset shareInstance] downloadVideoPlayerWithUrl:giftModel.play_image completion:^(BOOL result, NSString * _Nonnull fileName) {
|
||||
weakSelf.playerMp4View.hidden = YES;
|
||||
weakSelf.effectView.hidden = NO;
|
||||
/// svga下载播放
|
||||
[[QXRequset shareInstance] downloadVideoPlayerWithUrl:play_image completion:^(BOOL result, NSString * _Nonnull fileName) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
weakSelf.playerMp4View.hidden = YES;
|
||||
weakSelf.svagView.hidden = NO;
|
||||
});
|
||||
NSString *filePath = [QXFileManager getGiftVideoPath:fileName];
|
||||
[weakSelf.effectView loadSVGAPlayerWith:filePath];
|
||||
[weakSelf.svagView loadSVGAPlayerWith:filePath];
|
||||
}];
|
||||
}else {
|
||||
[self.lock lock];
|
||||
@@ -235,7 +346,7 @@
|
||||
// [self.playerView destroyPlayer];
|
||||
[self.playerMp4View stopHWDMP4];
|
||||
|
||||
[self.effectView removeFromSuperview];
|
||||
[self.svagView removeFromSuperview];
|
||||
[self.playerMp4View removeFromSuperview];
|
||||
|
||||
_svagView = nil;
|
||||
@@ -257,7 +368,7 @@
|
||||
return _giftArray;
|
||||
}
|
||||
|
||||
- (QXEffectSvgaView *)effectView {
|
||||
- (QXEffectSvgaView *)svagView {
|
||||
if (!_svagView) {
|
||||
_svagView = [[QXEffectSvgaView alloc] initWithFrame:CGRectZero isAutoPlay:YES];
|
||||
__weak typeof(self)weakSelf = self;
|
||||
|
||||
Reference in New Issue
Block a user