优化提交

This commit is contained in:
启星
2025-09-19 11:38:43 +08:00
parent a3a7bfdf22
commit 231d3d8625
153 changed files with 20460 additions and 11929 deletions

View File

@@ -29,7 +29,7 @@ static NSString *PLAY_IMAGE = @"play_image";
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
manager = [[QXGiftPlayerManager alloc] init];
// [manager creatDatabase];
// [manager creatDatabase];
});
return manager;
}
@@ -41,7 +41,7 @@ static NSString *PLAY_IMAGE = @"play_image";
// NSString *dbFilePath = [documentPath stringByAppendingPathComponent:@"qx_gift.db"];
// return dbFilePath;
//}
//
//
////
//- (void)creatDatabase
//{
@@ -127,11 +127,12 @@ static NSString *PLAY_IMAGE = @"play_image";
}
- (void)displayFullEffectView:(NSString *)gift {
// [self insertGiftWithPlayImage:gift];
// [self insertGiftWithPlayImage:gift];
[self.fullEffectView displayEffectView:gift];
}
- (void)displayFullEffectViewWithMorePlayImages:(NSArray *)playImages{
[self.fullEffectView displayEffectViewWithMorePlayImages:playImages];
}
- (void)displayChatEffectView:(NSString *)gift {
[self.chatEffectView displayEffectView:gift];
@@ -160,6 +161,10 @@ static NSString *PLAY_IMAGE = @"play_image";
[self.fullEffectView stopPlay];
[self.chatEffectView stopPlay];
}
-(void)startPlay{
[self.fullEffectView startPlay];
[self.chatEffectView startPlay];
}
- (UIView *)bgEffectView {
if (!_bgEffectView) {
_bgEffectView = [[UIView alloc] init];
@@ -252,6 +257,30 @@ static NSString *PLAY_IMAGE = @"play_image";
}
});
}
/// gift
- (void)displayEffectViewWithMorePlayImages:(NSArray *)playImages {
dispatch_async(self.queue, ^{
/// play_imagereturn
if (playImages.count == 0) {
return;
}
/// list
[self.lock lock];
/// list
[self.giftArray addObjectsFromArray:playImages];
NSLog(@"当前礼物有---%ld个",self.giftArray.count);
///
[self.lock unlock];
///
if (self.isLoadEffect == NO) {
///
self.isLoadEffect = YES;
[self loadStartSVGAPlayer];
}
});
}
- (void)openOrCloseEffectViewWith:(BOOL)isShow {
_isShow = isShow;
[self removeSvgaQueueData];
@@ -264,13 +293,18 @@ static NSString *PLAY_IMAGE = @"play_image";
[self setHidden:!isShow];
}
-(void)stopPlay{
[self removeSvgaQueueData];
// [self removeSvgaQueueData];
self.isLoadEffect = NO;
[self.svagView stopEffectSvgaPlay];
// [self.playerView stop];
[self.playerMp4View stopHWDMP4];
// [self.alphaVideoView stop];
self.playerMp4View.hidden = YES;
self.svagView.hidden = YES;
}
-(void)startPlay{
[self loadStartSVGAPlayer];
}
-(void)viewDidFinishPlayMP4:(NSInteger)totalFrameCount view:(VAPView *)container{
dispatch_async(dispatch_get_main_queue(), ^{
@@ -280,6 +314,14 @@ static NSString *PLAY_IMAGE = @"play_image";
[self loadStartSVGAPlayer];
});
}
-(void)viewDidFailPlayMP4:(NSError *)error{
dispatch_async(dispatch_get_main_queue(), ^{
self.playerMp4View.hidden = YES;
});
dispatch_async(dispatch_get_main_queue(), ^{
[self loadStartSVGAPlayer];
});
}
- (void)loadStartSVGAPlayer {
if (!_isShow) {
/// isshow return
@@ -311,7 +353,7 @@ static NSString *PLAY_IMAGE = @"play_image";
weakSelf.playerMp4View.hidden = NO;
weakSelf.svagView.hidden = YES;
});
[weakSelf.playerMp4View stopHWDMP4];
[weakSelf.playerMp4View playHWDMP4:videoPath delegate:self];
}];
}else if ([play_image hasSuffix:@"svg"] || [play_image hasSuffix:@"svga"]) {
@@ -329,6 +371,7 @@ static NSString *PLAY_IMAGE = @"play_image";
[self.lock lock];
self.isLoadEffect = NO;
[self.lock unlock];
[self loadStartSVGAPlayer];
}
});
}
@@ -382,7 +425,7 @@ static NSString *PLAY_IMAGE = @"play_image";
-(VAPView *)playerMp4View{
if (!_playerMp4View) {
_playerMp4View = [[VAPView alloc] initWithFrame:CGRectZero];
_playerMp4View.hwd_enterBackgroundOP = HWDMP4EBOperationTypePauseAndResume;
_playerMp4View.hwd_enterBackgroundOP = HWDMP4EBOperationTypeStop;
_playerMp4View.contentMode = UIViewContentModeScaleAspectFit;
_playerMp4View.userInteractionEnabled = NO;
_playerMp4View.backgroundColor = [UIColor clearColor];