@lottiefiles/lottie-player
Advanced tools
Comparing version 0.0.7 to 0.1.0
{ | ||
"name": "@lottiefiles/lottie-player", | ||
"version": "0.0.7", | ||
"version": "0.1.0", | ||
"description": "Lottie animation player web component.", | ||
@@ -5,0 +5,0 @@ "main": "dist/lottie-player.js", |
@@ -54,2 +54,22 @@ ## lottie-player Web Component | ||
You may set and load animations programatically as well. | ||
```html | ||
<lottie-player | ||
autoplay | ||
controls | ||
loop | ||
mode="normal" | ||
style="width: 320px" | ||
> | ||
</lottie-player> | ||
``` | ||
```js | ||
const player = document.querySelector('lottie-player'); | ||
player.load('https://assets3.lottiefiles.com/packages/lf20_UJNc2t.json'); | ||
// or load via a Bodymovin JSON string/object | ||
player.load('{"v":"5.3.4","fr":30,"ip":0,"op":38,"w":315,"h":600,"nm":"new", ... }'); | ||
``` | ||
## Properties | ||
@@ -83,3 +103,18 @@ | ||
### `load(src: string | object) => void` | ||
Load (and play) a given Bodymovin animation. | ||
#### Parameters | ||
| Name | Type | Description | | ||
| ------- | -------- | ----------------- | | ||
| `src` | `string` or `object` | URL, or a JSON string or object representing a Bodymovin JSON. | | ||
#### Returns | ||
Type: `void` | ||
### `pause() => void` | ||
@@ -199,2 +234,19 @@ | ||
## Events | ||
The following events are exposed and can be listened to via `addEventListener` calls. | ||
| Name | Description | | ||
| ----------- | ----------------- | | ||
| `load` | Animation data is loaded. | | ||
| `error` | An animation source cannot be parsed or fails to load. | | ||
| `ready` | Animation data is loaded and player is ready. | | ||
| `play` | Animation starts playing. | | ||
| `pause` | Animation is paused. | | ||
| `stop` | Animation is stopped. | | ||
| `freeze` | Animation is paused. | | ||
| `loop` | An animation loop is completed. | | ||
| `complete` | Animation is complete (all loops completed). | | ||
| `frame` | A new frame is entered. | | ||
## Styling | ||
@@ -201,0 +253,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1096471
1130
263