---
url: https://cri-middleware.github.io/SSPlayerForReactNative/api/interfaces/SpriteStudioPlayerApi.md
---
# Interface: SpriteStudioPlayerApi

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:53](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L53)

The transport surface, with no drawing backend in it.

Stated as an interface so the Layer 4 prop types and this API are shared without
a drawing backend. Anything Skia-shaped belongs on the class below, not here.

## Properties

### currentAnimation

> `readonly` **currentAnimation**: `string` | `null`

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:59](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L59)

***

### frameNo

> `readonly` **frameNo**: `number`

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:54](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L54)

***

### isFinished

> `readonly` **isFinished**: `boolean`

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:56](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L56)

***

### isPlaying

> `readonly` **isPlaying**: `boolean`

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:55](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L55)

***

### isPlayingForward

> `readonly` **isPlayingForward**: `boolean`

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:58](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L58)

Whether the playhead is travelling forward this frame. Gate audio on it.

## Methods

### advance()

> **advance**(`dtMilliseconds`): `void`

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:130](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L130)

Advances the clock by `dtMilliseconds`. The default drive — see the class
comment. Milliseconds is the Brain's unit and is carried unconverted
through every layer, so there is no seam for a 1000x to hide in.

#### Parameters

##### dtMilliseconds

`number`

#### Returns

`void`

***

### getAnimationNames()

> **getAnimationNames**(): `string`\[]

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:87](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L87)

Every animation in the loaded pack, in the order the `.ssab` lists them.

Empty until a load finishes, so a caller building a picker off it should
read it from `onLoad` rather than on mount. The names are exactly what
`setAnimation` takes — there is no separate id, which is why this is worth
exposing rather than making callers hard-code a list that the next
conversion can invalidate.

#### Returns

`string`\[]

***

### pause()

> **pause**(): `void`

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:69](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L69)

Holds playback where it stands. Idempotent, ignored while nothing plays.

#### Returns

`void`

***

### play()

> **play**(`startFrame?`): `void`

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:67](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L67)

**Head-out.** Rewinds to the start of the section and re-arms the loop
count — it is not a resume, and using it to lift a `pause()` sends the
playhead back to the start. That is the Brain's contract, and these four
verbs are kept distinct here.

#### Parameters

##### startFrame?

`number`

#### Returns

`void`

***

### resume()

> **resume**(): `void`

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:74](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L74)

Lifts a [pause](#pause), carrying on from the same frame. Idempotent, and a
no-op on a stopped animation — starting one is [play](#play)'s job.

#### Returns

`void`

***

### seek()

> **seek**(`frameNo`): `void`

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:88](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L88)

#### Parameters

##### frameNo

`number`

#### Returns

`void`

***

### setAnimation()

> **setAnimation**(`name`): `boolean`

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:77](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L77)

#### Parameters

##### name

`string`

#### Returns

`boolean`

***

### setAnimationSection()

> **setAnimationSection**(`startFrame`, `endFrame`): `boolean`

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:102](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L102)

Restricts playback to `[startFrame, endFrame]` of the current animation.
Returns false, and warns once per pair, when it did nothing.

#### Parameters

##### startFrame

`number`

##### endFrame

`number`

#### Returns

`boolean`

***

### setAnimationSectionByLabel()

> **setAnimationSectionByLabel**(`startLabel`, `endLabel`, `startOffset?`, `endOffset?`): `boolean`

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:104](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L104)

[setAnimationSection](#setanimationsection) with the ends named by labels of the current animation.

#### Parameters

##### startLabel

`string`

##### endLabel

`string`

##### startOffset?

`number`

##### endOffset?

`number`

#### Returns

`boolean`

***

### setFrameRate()

> **setFrameRate**(`fps`): `void`

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:119](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L119)

Overrides the advance rate, in absolute frames per second. `0` clears the
override and hands playback back to whatever each animation was authored at.

#### Parameters

##### fps

`number`

#### Returns

`void`

***

### setFrameSkipEnabled()

> **setFrameSkipEnabled**(`enabled`): `void`

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:114](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L114)

Whether a long tick may skip frames to stay on the wall clock (the default)
or advance exactly one frame, stretching playback instead.

#### Parameters

##### enabled

`boolean`

#### Returns

`void`

***

### setLoopCount()

> **setLoopCount**(`loops`): `void`

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:97](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L97)

0 = infinite.

#### Parameters

##### loops

`number`

#### Returns

`void`

***

### setSpeedScale()

> **setSpeedScale**(`rate`): `void`

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:95](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L95)

Multiplier on the authored frame rate. `0` and negatives **stop** the
playhead where it stands rather than turning it around — reversing is
`setPlaybackDirection`'s job, not the speed's, and the Brain clamps both to
the same stop.

#### Parameters

##### rate

`number`

#### Returns

`void`

***

### setSubFrameEnabled()

> **setSubFrameEnabled**(`enabled`): `void`

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:124](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L124)

Sub-frame interpolation, on by default: whether what is drawn may sit
between two authored frames.

#### Parameters

##### enabled

`boolean`

#### Returns

`void`

***

### stop()

> **stop**(): `void`

Defined in: [packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts:76](https://github.com/cri-middleware/SSPlayerForReactNative/blob/ddb0878ad347fd4a411e4e2eb0829a948cb07ff8/packages/react-native-spritestudio/src/player/SpriteStudioPlayer.ts#L76)

Ends playback. Nothing rewinds; the frame it stopped on stays on screen.

#### Returns

`void`
