diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..c7bcdd1b Binary files /dev/null and b/.DS_Store differ diff --git a/Source/SVGAPlayer.h b/Source/SVGAPlayer.h index cdeb8ccf..6ff16d38 100644 --- a/Source/SVGAPlayer.h +++ b/Source/SVGAPlayer.h @@ -33,6 +33,7 @@ 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; diff --git a/Source/SVGAPlayer.m b/Source/SVGAPlayer.m index 289e09f0..cd47c90d 100644 --- a/Source/SVGAPlayer.m +++ b/Source/SVGAPlayer.m @@ -32,7 +32,7 @@ @interface SVGAPlayer () @property (nonatomic, assign) BOOL forwardAnimating; @property (nonatomic, assign) BOOL reversing; -@end +@end @implementation SVGAPlayer @@ -250,6 +250,9 @@ - (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.muteAudio == YES) { + audioLayer.audioPlayer.volume = 0.0; + } [audioLayers addObject:audioLayer]; }]; self.audioLayers = audioLayers; 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)