This commit is contained in:
启星
2025-09-22 14:58:13 +08:00
parent 2776cf66c2
commit 048b9339eb
91 changed files with 518 additions and 131 deletions

View File

@@ -21,7 +21,8 @@ NS_ASSUME_NONNULL_BEGIN
-(void)setHeadIcon:(NSString*)headerIcon
dress:(NSString*)dress;
-(void)stopHWDMP4;
-(void)playHWDMP4;
@end
NS_ASSUME_NONNULL_END

View File

@@ -14,6 +14,8 @@
@property (nonatomic,strong) QXEffectSvgaView *svgaView;
@property (nonatomic,strong) VAPView *mp4View;
@property (nonatomic,strong) NSString *dress;
@property (nonatomic,strong) NSString *videoPath;
@end
@implementation QXSeatHeaderView
- (instancetype)initWithCoder:(NSCoder *)coder
@@ -62,6 +64,7 @@
-(void)setHeadIcon:(NSString *)headerIcon
dress:(nonnull NSString *)dress{
_dress = dress;
NSString *dressUrl = [dress stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
[self.headImageView sd_setImageWithURL:[NSURL URLWithString:headerIcon] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
if (dressUrl.length > 0 && ([dressUrl hasPrefix:@"http"] || [dressUrl hasPrefix:@"https"])) {
@@ -79,6 +82,7 @@
MJWeakSelf
[[QXRequset shareInstance] downloadVideoPlayerWithUrl:dressUrl completion:^(BOOL result, NSString * _Nonnull fileName) {
NSString *videoPath = [QXFileManager getGiftVideoPath:dressUrl.lastPathComponent];
weakSelf.videoPath = videoPath;
[weakSelf.mp4View playHWDMP4:videoPath repeatCount:INTMAX_MAX delegate:self];
}];
}else{
@@ -100,6 +104,18 @@
[self.mp4View setHidden:YES];
}
}
-(void)stopHWDMP4{
if (![_dress isExist]) {
return;
}
[self.mp4View stopHWDMP4];
}
-(void)playHWDMP4{
if (![_dress isExist]) {
return;
}
[self.mp4View playHWDMP4:self.videoPath repeatCount:INTMAX_MAX delegate:self];
}
- (QXEffectSvgaView *)svgaView {
if (!_svgaView) {
_svgaView = [[QXEffectSvgaView alloc] initWithFrame:CGRectZero isAutoPlay:YES];
@@ -110,7 +126,7 @@
- (VAPView *)mp4View {
if (!_mp4View) {
_mp4View = [[VAPView alloc] initWithFrame:CGRectZero];
_mp4View.hwd_enterBackgroundOP = HWDMP4EBOperationTypePauseAndResume;
_mp4View.hwd_enterBackgroundOP = HWDMP4EBOperationTypeDoNothing;
_mp4View.contentMode = UIViewContentModeScaleAspectFit;
_mp4View.userInteractionEnabled = NO;
_mp4View.backgroundColor = [UIColor clearColor];