From 2cb390ccf1b857d0ec65b16bfced11431ddde2a2 Mon Sep 17 00:00:00 2001 From: vincent <> Date: Wed, 16 Oct 2024 18:07:17 +0800 Subject: [PATCH 1/3] feat: add mute --- .DS_Store | Bin 0 -> 6148 bytes Source/SVGAPlayer.h | 1 + Source/SVGAPlayer.m | 10 +++++++++- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..2fcfc5f377cdb5591e28790efa6b36d8b878826f GIT binary patch literal 6148 zcmeHKO-sW-5PhpT6niNm;z{xgg#LrHM7$OXUhPMUqA4jAQE&NQ9u@zH9{d4%_s!0# z4OJluB02**Z!^1ZH}haKSpcqkmbHNvfCigjv_|)i$+)y7TL}>vbbgH4cGIlCL^V;_6yVDbF!-~wY5$atD(JkJG=^TT$3Tuf)0#N$&P?zBkLQC^J5 zX*}FtuiqWqcIxr7Z}DeG3-9g*+!~vo*1V9ge5G!@O80;Yf|@T!1(A7VDaBw(rNKOJ=b3P6k)_Qt;4 zC4>_POahjQ9HBX-5|!%06~if=@i@#&0+xzOhx0pgov^bDHx%c0XFT@P;Sxpjrhq9> zRbW*gTT=gbKfeE0N%mw4m;!%F0T-qHw9Ax2ZCy%EYHiFmU=x#hrJ|?Mg>vjWQi`|O aym2g+4lxN>Dl$T|9|13eIaA Date: Wed, 16 Oct 2024 18:09:02 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E5=86=99?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 6148 -> 6148 bytes Source/SVGAPlayer.m | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.DS_Store b/.DS_Store index 2fcfc5f377cdb5591e28790efa6b36d8b878826f..f4d3c7a4977362b1aa37a8dfa62b04bebc3955ed 100644 GIT binary patch delta 30 mcmZoMXffE}#=`U=WHJwn&g2r7KBfSM$!Ay%Hk+_s5CQ<2vI)fi delta 30 mcmZoMXffE}#=`XF>tr4loyjFEeM|`qlh3dkY&K!NAOrxY?+SVV diff --git a/Source/SVGAPlayer.m b/Source/SVGAPlayer.m index e30e9928..eb15a2bc 100644 --- a/Source/SVGAPlayer.m +++ b/Source/SVGAPlayer.m @@ -256,7 +256,7 @@ - (void)draw { [self.videoItem.audios enumerateObjectsUsingBlock:^(SVGAAudioEntity * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { SVGAAudioLayer *audioLayer = [[SVGAAudioLayer alloc] initWithAudioItem:obj videoItem:self.videoItem]; if (self.isMuted == YES) { - audioLayer.audioLayer.volume = 0.0; + audioLayer.audioPlayer.volume = 0.0; } [audioLayers addObject:audioLayer]; }]; From 99f5ee17d07a013ece750546836c2c71e26411dd Mon Sep 17 00:00:00 2001 From: shendoublexiang Date: Wed, 16 Oct 2024 18:25:36 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=AE=9E=E7=8E=B0=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 6148 -> 6148 bytes Source/SVGAPlayer.h | 2 +- Source/SVGAPlayer.m | 7 +------ Source/pbobjc/Svga.pbobjc.m | 1 + 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.DS_Store b/.DS_Store index f4d3c7a4977362b1aa37a8dfa62b04bebc3955ed..c7bcdd1b78fe19167ad28abfef5c766fa3b25fd4 100644 GIT binary patch delta 31 ncmZoMXffE}%EHXZnmd_?MQ3seOCM7K!{jrp2AfS-F9-nujAscH delta 31 ncmZoMXffE}%EHX>A!ITSi_YW{mOiEchRJ7G4K|ywUJwERofQei diff --git a/Source/SVGAPlayer.h b/Source/SVGAPlayer.h index 686efab6..6ff16d38 100644 --- a/Source/SVGAPlayer.h +++ b/Source/SVGAPlayer.h @@ -33,12 +33,12 @@ typedef void(^SVGAPlayerDynamicDrawingBlock)(CALayer *contentLayer, NSInteger fr @property (nonatomic, assign) IBInspectable BOOL clearsAfterStop; @property (nonatomic, copy) NSString *fillMode; @property (nonatomic, copy) NSRunLoopMode mainRunLoopMode; +@property (nonatomic, assign) BOOL muteAudio; - (void)startAnimation; - (void)startAnimationWithRange:(NSRange)range reverse:(BOOL)reverse; - (void)pauseAnimation; - (void)stopAnimation; -- (void)muteAudio; - (void)clear; - (void)stepToFrame:(NSInteger)frame andPlay:(BOOL)andPlay; - (void)stepToPercentage:(CGFloat)percentage andPlay:(BOOL)andPlay; diff --git a/Source/SVGAPlayer.m b/Source/SVGAPlayer.m index eb15a2bc..cd47c90d 100644 --- a/Source/SVGAPlayer.m +++ b/Source/SVGAPlayer.m @@ -31,7 +31,6 @@ @interface SVGAPlayer () @property (nonatomic, assign) NSRange currentRange; @property (nonatomic, assign) BOOL forwardAnimating; @property (nonatomic, assign) BOOL reversing; -@property (nonatomic, assign) BOOL isMuted; @end @@ -121,10 +120,6 @@ - (void)pauseAnimation { [self stopAnimation:NO]; } -- (void)muteAudio { - self.isMuted = YES; -} - - (void)stopAnimation { [self stopAnimation:self.clearsAfterStop]; } @@ -255,7 +250,7 @@ - (void)draw { NSMutableArray *audioLayers = [NSMutableArray array]; [self.videoItem.audios enumerateObjectsUsingBlock:^(SVGAAudioEntity * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { SVGAAudioLayer *audioLayer = [[SVGAAudioLayer alloc] initWithAudioItem:obj videoItem:self.videoItem]; - if (self.isMuted == YES) { + if (self.muteAudio == YES) { audioLayer.audioPlayer.volume = 0.0; } [audioLayers addObject:audioLayer]; diff --git a/Source/pbobjc/Svga.pbobjc.m b/Source/pbobjc/Svga.pbobjc.m index 3fd8e4d7..a87c4ae8 100644 --- a/Source/pbobjc/Svga.pbobjc.m +++ b/Source/pbobjc/Svga.pbobjc.m @@ -13,6 +13,7 @@ #import "GPBProtocolBuffers_RuntimeSupport.h" #endif +#import #import "Svga.pbobjc.h" // @@protoc_insertion_point(imports)