• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

svga/SVGAPlayer-iOS: Similar to Lottie. Render After Effects / Animate CC (Flash ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

svga/SVGAPlayer-iOS

开源软件地址:

https://github.com/svga/SVGAPlayer-iOS

开源编程语言:

Objective-C 98.8%

开源软件介绍:

SVGAPlayer

简体中文

支持本项目

  1. 轻点 GitHub Star,让更多人看到该项目。

2.5.0 Released

This version add Support for matte layer and dynamic matte bitmap.
Head on over to Dynamic · Matte Layer

This version add Support for audio step to frame & percentage.

2.3.5 Released

This version fixed SVGAPlayer clearsAfterStop defaults too YES, Please check your player when it doesn't need to be cleared.

This version fixed SVGAPlayer render issue on iOS 13.1, upgrade to this version ASAP.

Introduce

SVGAPlayer is a light-weight animation renderer. You use tools to export svga file from Adobe Animate CC or Adobe After Effects, and then use SVGAPlayer to render animation on mobile application.

SVGAPlayer-iOS render animation natively via iOS CoreAnimation Framework, brings you a high-performance, low-cost animation experience.

If wonder more information, go to this website.

Usage

Here introduce SVGAPlayer-iOS usage. Wonder exporting usage? Click here.

Install Via CocoaPods

You want to add pod 'SVGAPlayer', '~> 2.3' similar to the following to your Podfile:

target 'MyApp' do pod 'SVGAPlayer', '~> 2.3' end

Then run a pod install inside your terminal, or from CocoaPods.app.

Locate files

SVGAPlayer could load svga file from application bundle or remote server.

Using code

Create a SVGAPlayer instance.

SVGAPlayer *player = [[SVGAPlayer alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
[self.view addSubview:player]; // Add subview by yourself.

Create a SVGAParser instance, parse from bundle like this.

SVGAParser *parser = [[SVGAParser alloc] init];
[parser parseWithNamed:@"posche" inBundle:nil completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
    
} failureBlock:nil];

Create a SVGAParser instance, parse from remote server like this.

SVGAParser *parser = [[SVGAParser alloc] init];
[parser parseWithURL:[NSURL URLWithString:@"https://github.com/yyued/SVGA-Samples/blob/master/posche.svga?raw=true"] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) {
    
} failureBlock:nil];

Set videoItem to SVGAPlayer, play it as you want.

[parser parseWithURL:[NSURL URLWithString:@"https://github.com/yyued/SVGA-Samples/blob/master/posche.svga?raw=true"] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) {
    if (videoItem != nil) {
        player.videoItem = videoItem;
        [player startAnimation];
    }
} failureBlock:nil];

Cache

SVGAParser use NSURLSession request remote data via network. You may use following ways to control cache.

Response Header

Server response SVGA files in Body, and response header either. response header has cache-control / etag / expired keys, all these keys telling NSURLSession how to handle cache.

Request NSData By Yourself

If you couldn't fix Server Response Header, You should build NSURLRequest with CachePolicy by yourself, and fetch NSData.

Deliver NSData to SVGAParser, as usual.

Features

Here are many feature samples.

APIs

Head on over to https://github.com/yyued/SVGAPlayer-iOS/wiki/APIs

CHANGELOG

Head on over to CHANGELOG




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap