SVGA

集成指南

将播放器集成至 iOS / Android / Web

iOS

  • 使用 CocoaPods 集成源码,将以下依赖:

  • pod 'SVGAPlayer'

  • 添加至 Podfile 文件。

  • 使用代码或 IB 添加 SVGAPlayer 至 View 中,具体方法参见:
    https://github.com/yyued/SVGAPlayer-iOS

  • Open https://github.com/yyued/SVGAPlayer-iOS to download the source code.

  • Add the code in Source to your project.

  • Create the SVGAPlayer instance to the UIView just like the example.

  • You can also use CocoaPods, add the code:

    pod 'SVGAPlayer'

    to the Podfile of your project.

Android

  • 使用 Gradle 集成源码,添加 JitPack.io 到 root build.gradle 中

    allprojects {
      repositories {
        ...
        maven { url 'https://jitpack.io' }
      }
    }

  • 添加以下依赖:

    compile 'com.github.yyued:SVGAPlayer-Android:2.0.0'

  • 根据需要修改版本号,要获取最新的版本请点入:
    https://jitpack.io/#yyued/SVGAPlayer-Android

  • 使用代码或 XML 添加 SVGAImageView 至 View 中,具体方法参见:
    https://github.com/yyued/SVGAPlayer-Android

  • Open https://github.com/yyued/SVGAPlayer-Android to download the source code.

  • Add the code in

    library/src/main/java/com/opensource/svgaplayer

    to your project.

  • Create the SVGAImageView for SVGAPlayer to the layout.xml just like the example.

  • You can also use Gradle, add JitPack.io to root build.gradle

    allprojects {
      repositories {
        ...
        maven { url 'https://jitpack.io' }
      }
    }

  • Add the following dependencies:

    compile 'com.github.yyued:SVGAPlayer-Android:1.2.4'
    compile 'org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.1'

  • Modify the version number as needed, and click in for the latest version
    https://jitpack.io/#yyued/SVGAPlayer-Android

Web