@effing/annie-player 0.38.0 → 0.38.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -123,16 +123,18 @@ function HeadlessPlayer() {
|
|
|
123
123
|
|
|
124
124
|
#### Available Sub-components
|
|
125
125
|
|
|
126
|
-
| Component
|
|
127
|
-
|
|
|
128
|
-
| `AnniePlayer.Root`
|
|
129
|
-
| `AnniePlayer.Wrapper`
|
|
130
|
-
| `AnniePlayer.Canvas`
|
|
131
|
-
| `AnniePlayer.Controls`
|
|
132
|
-
| `AnniePlayer.LoadButton`
|
|
133
|
-
| `AnniePlayer.PlayButton`
|
|
134
|
-
| `AnniePlayer.PauseButton`
|
|
135
|
-
| `AnniePlayer.
|
|
126
|
+
| Component | Description |
|
|
127
|
+
| -------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
128
|
+
| `AnniePlayer.Root` | Provider that manages player state. Accepts `src`, `height`, `defaultWidth`, `fps`, `autoLoad`, `autoPlay`. |
|
|
129
|
+
| `AnniePlayer.Wrapper` | Container with hover detection. Sets `data-hovering` and `data-playing` attributes. |
|
|
130
|
+
| `AnniePlayer.Canvas` | The canvas element where frames are rendered. |
|
|
131
|
+
| `AnniePlayer.Controls` | Container for buttons. Auto-hides when playing (unless hovering). |
|
|
132
|
+
| `AnniePlayer.LoadButton` | Load button with default "Load"/"Loading..." text. |
|
|
133
|
+
| `AnniePlayer.PlayButton` | Play button with default "Play" text. |
|
|
134
|
+
| `AnniePlayer.PauseButton` | Pause button with default "Pause" text. |
|
|
135
|
+
| `AnniePlayer.Scrubber` | Range slider that seeks through frames. Accepts `pauseWhileScrubbing`. |
|
|
136
|
+
| `AnniePlayer.FrameCounter` | Shows `current / total` frame. Accepts a render-prop child `({ current, total }) => ReactNode`. |
|
|
137
|
+
| `AnniePlayer.Status` | Status overlay showing current state. |
|
|
136
138
|
|
|
137
139
|
### Vanilla JavaScript
|
|
138
140
|
|
|
@@ -176,6 +178,7 @@ class AnniePlayerCore {
|
|
|
176
178
|
play(): void;
|
|
177
179
|
pause(): void;
|
|
178
180
|
stop(): void;
|
|
181
|
+
seek(frameIndex: number): void;
|
|
179
182
|
|
|
180
183
|
// State
|
|
181
184
|
getState(): AnniePlayerState;
|
|
@@ -205,6 +208,7 @@ type AnniePlayerState = {
|
|
|
205
208
|
isLoading: boolean;
|
|
206
209
|
isPlaying: boolean;
|
|
207
210
|
frameCount: number;
|
|
211
|
+
currentFrame: number;
|
|
208
212
|
dimensions: { width: number; height: number } | null;
|
|
209
213
|
};
|
|
210
214
|
```
|