---
url: https://cri-middleware.github.io/SSPlayerForReactNative/api/type-aliases/SsSource.md
---
# Type Alias: SsSource

> **SsSource** = `string` | { `uri`: `string`; }

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

Where a `.ssab` comes from.

Always a **location**, never a bundler handle, and that is the whole point.
A pack is a directory: the `.ssab` names its textures, the external `.ssab`s
its Instance parts reach and — through a `.ssqb` — the packs it sequences,
all by paths relative to itself. So a source has to be something whose
*directory* still exists on the device.

Three spellings, matching `SsUriScheme`:

| | |
|---|---|
| `'ss/overall/Basic.ssab'` | inside the app's asset directory — what you ship |
| `'file:///…'`, `'/…'` | a real directory: a download, `Documents/`, anything unpacked |
| `'http://…'` | a dev server or a CDN |

`{ uri }` is accepted for all three, for symmetry with React Native's own
source props.

## Why not `require()`

It cannot carry a directory. Metro ships a dependency *graph* — it bundles
only what a `require()` names and never walks a directory — and on an Android
release build the packager then flattens and lowercases what it did name into
`res/`, so `dirname()` of a bundled asset points at nothing. A `require()`
source works in development and then silently loses every name it carries
when shipped, which is the failure this API is shaped to avoid. The pack
directories are copied in out-of-band instead — see `plugin/`.
