# svgaplayer-react-native

> ## 安装

Latest version **1.0.2** (published 2021-04-10) · 0 weekly downloads

## Install

```sh
npm install svgaplayer-react-native
pnpm add svgaplayer-react-native
yarn add svgaplayer-react-native
bun add svgaplayer-react-native
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-04-10 |
| First published | 2021-04-10 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 28.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jianglingzhi |
| Keywords | react-native |

## Links

- npm: https://www.npmjs.com/package/svgaplayer-react-native
- npm.io page: https://npm.io/package/svgaplayer-react-native

## Recent versions

- 1.0.2 (latest) — 2021-04-10
- 1.0.0 — 2021-04-10

## README

# react-native-svgaplayer

## 安装

`$ npm install svgaplayer-react-native`

### React Naitve <= 5.9

`$ react-native link svgaplayer-react-native`


#### Android

添加混淆规则

-keep class com.squareup.wire.** { *; } </br>
-keep class com.opensource.svgaplayer.proto.** { *; }

#### iOS

在podfile 添加 pod 'SVGAPlayer', '~> 2.3'



## 属性

**url**</br>
***仅支持网络路径***</br>

**loops**</br>
***循环播放次数,0为无限循环***</br>

**autoPlay**</br>
***加载完成后是否自动播放***</br>
* ***true(默认)*** 自动播放</br>
* ***false***

**fillMode**</br>
***播放完成后保留第一帧或最后一帧***</br>
* ***Backward*** 最后一针</br>
* ***Forward(默认)*** 第一帧</br>

**clearsAfterStop**</br>
***播放完成后是否清除画布***</br>
* ***true(默认)*** 清除</br>
* ***false***

**onComplete**</br>
***加载完成时回调***</br>

**onError**</br>
***加载错误时回调***</br>

**onPause**</br>
***暂停时回调***</br>

**onFinished**</br>
***播放完成时回调(无限循环时不会触发)***</br>

**onRepeat**</br>
***重复播放时触发***</br>

**onStep(frame:string,percentage:number)**</br>
***播放进度回调返回当前帧与进度***</br>

## 方法
**start()**</br>
***开始播放***</br>

**pause()**</br>
***暂停播放***</br>

**stepToFrame(frame:number,andPlay:boolean)**</br>
***设置到指定帧数，是否继续播放***</br>

**stepToPercentage(percentage:number,andPlay:boolean)**</br>
***设置到指定进度，是否继续播放***</br>

---
_Source: https://npm.io/package/svgaplayer-react-native · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
