Skip to content

Commit 2b28845

Browse files
committed
feat: update 2.x proto support for matte.
1 parent fc9d7ef commit 2b28845

File tree

7 files changed

+11
-4
lines changed

7 files changed

+11
-4
lines changed

SVGAPlayer.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
63712E6821787A45001AE014 /* SVGAAudioEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = 63712E6721787A45001AE014 /* SVGAAudioEntity.m */; };
1313
63E817012178809D001D2D62 /* SVGAAudioLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 63E817002178809D001D2D62 /* SVGAAudioLayer.m */; };
1414
71418C93225E6F710029C69E /* mutiMatte.svga in Resources */ = {isa = PBXBuildFile; fileRef = 71418C92225E6F710029C69E /* mutiMatte.svga */; };
15+
71A8679122B7785100176CD6 /* matteRect.svga in Resources */ = {isa = PBXBuildFile; fileRef = 71A8679022B7785100176CD6 /* matteRect.svga */; };
1516
80D4C7254846B96B9C6EED83 /* libPods-SVGAPlayer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DDA5FF396660C7C932DF9B8 /* libPods-SVGAPlayer.a */; };
1617
904D41F81D223DD20085A21A /* SVGABezierPath.m in Sources */ = {isa = PBXBuildFile; fileRef = 904D41F71D223DD20085A21A /* SVGABezierPath.m */; };
1718
9052FC631E6EB8D4007BC925 /* SVGAExporter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9052FC621E6EB8D4007BC925 /* SVGAExporter.m */; };
@@ -65,6 +66,7 @@
6566
63E816FF2178809D001D2D62 /* SVGAAudioLayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAAudioLayer.h; sourceTree = "<group>"; };
6667
63E817002178809D001D2D62 /* SVGAAudioLayer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SVGAAudioLayer.m; sourceTree = "<group>"; };
6768
71418C92225E6F710029C69E /* mutiMatte.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = mutiMatte.svga; sourceTree = "<group>"; };
69+
71A8679022B7785100176CD6 /* matteRect.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = matteRect.svga; sourceTree = "<group>"; };
6870
8AD65028FA2D122A34DC4A63 /* Pods-SVGAPlayer.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SVGAPlayer.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SVGAPlayer/Pods-SVGAPlayer.debug.xcconfig"; sourceTree = "<group>"; };
6971
904D41F61D223DD20085A21A /* SVGABezierPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGABezierPath.h; sourceTree = "<group>"; };
7072
904D41F71D223DD20085A21A /* SVGABezierPath.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVGABezierPath.m; sourceTree = "<group>"; };
@@ -241,6 +243,7 @@
241243
90D7C9FA1F7E2AA3006E74F0 /* Samples */ = {
242244
isa = PBXGroup;
243245
children = (
246+
71A8679022B7785100176CD6 /* matteRect.svga */,
244247
71418C92225E6F710029C69E /* mutiMatte.svga */,
245248
63712E6421787950001AE014 /* heartbeat.svga */,
246249
90D7CA1A1F7FB114006E74F0 /* rose_1.5.0.svga */,
@@ -356,6 +359,7 @@
356359
63712E6521787950001AE014 /* heartbeat.svga in Resources */,
357360
90A676EB1D13A6DF008A69F3 /* Main.storyboard in Resources */,
358361
90CB64F91EF297E800DAA382 /* SVGAPlayer React-Info.plist in Resources */,
362+
71A8679122B7785100176CD6 /* matteRect.svga in Resources */,
359363
90D7CA1C1F7FB114006E74F0 /* rose_1.5.0.svga in Resources */,
360364
90D7CA1B1F7FB114006E74F0 /* rose_2.0.0.svga in Resources */,
361365
);

SVGAPlayer/Samples/matteRect.svga

623 Bytes
Binary file not shown.

SVGAPlayer/ViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ - (void)viewDidLoad {
3030
}
3131

3232
- (IBAction)onChange:(id)sender {
33-
[parser parseWithNamed:@"rose_2.0.0"
33+
[parser parseWithNamed:@"matteRect"
3434
inBundle:[NSBundle mainBundle] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
3535
if (videoItem != nil) {
3636
self.aPlayer.videoItem = videoItem;

Source/SVGAVideoEntity.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ @interface SVGAVideoSpriteEntity()
208208

209209
@property (nonatomic, copy) NSString *imageKey;
210210
@property (nonatomic, copy) NSArray<SVGAVideoSpriteFrameEntity *> *frames;
211+
@property (nonatomic, copy) NSString *matteKey;
211212

212213
@end
213214

Source/SVGAVideoSpriteEntity.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
@interface SVGAVideoSpriteEntity : NSObject
1616

1717
@property (nonatomic, readonly) NSString *imageKey;
18-
@property (nonatomic, readonly) NSString *matteKey;
1918
@property (nonatomic, readonly) NSArray<SVGAVideoSpriteFrameEntity *> *frames;
19+
@property (nonatomic, readonly) NSString *matteKey;
2020

2121
- (instancetype)initWithJSONObject:(NSDictionary *)JSONObject;
2222
- (instancetype)initWithProtoObject:(SVGAProtoSpriteEntity *)protoObject;

Source/SVGAVideoSpriteEntity.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ - (instancetype)initWithJSONObject:(NSDictionary *)JSONObject {
2929
[frames addObject:[[SVGAVideoSpriteFrameEntity alloc] initWithJSONObject:obj]];
3030
}
3131
}];
32-
_matteKey = matteKey;
3332
_imageKey = imageKey;
3433
_frames = frames;
34+
_matteKey = matteKey;
3535
}
3636
}
3737
}
@@ -43,6 +43,7 @@ - (instancetype)initWithProtoObject:(SVGAProtoSpriteEntity *)protoObject {
4343
if (self) {
4444
if ([protoObject isKindOfClass:[SVGAProtoSpriteEntity class]]) {
4545
NSString *imageKey = protoObject.imageKey;
46+
NSString *matteKey = protoObject.matteKey;
4647
NSArray<NSDictionary *> *protoFrames = [protoObject.framesArray copy];
4748
if ([imageKey isKindOfClass:[NSString class]] && [protoFrames isKindOfClass:[NSArray class]]) {
4849
NSMutableArray<SVGAVideoSpriteFrameEntity *> *frames = [[NSMutableArray alloc] init];
@@ -53,6 +54,7 @@ - (instancetype)initWithProtoObject:(SVGAProtoSpriteEntity *)protoObject {
5354
}];
5455
_imageKey = imageKey;
5556
_frames = frames;
57+
_matteKey = matteKey;
5658
}
5759
}
5860
}

Source/pbobjc/Svga.pbobjc.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)