> ## Documentation Index
> Fetch the complete documentation index at: https://docs.beyondwords.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Player API

The BeyondWords Player API lets you control and interact with the player programmatically—controlling playback, reading state, listening to events, and updating player properties at runtime.

The API is available on all player platforms. On iOS and Android, the native SDKs expose the same properties and methods through their `PlayerView` wrappers.

When you set a property both in the dashboard and in your embed code or SDK configuration, the value passed at initialization takes precedence. See [programmatic control](/docs-and-guides/distribution/player/developer-guides/programmatic-control) for override order details.

<CardGroup cols={3}>
  <Card title="Player properties" icon="sliders" href="/docs-and-guides/distribution/player/developer-guides/player-properties">
    Read and set player configuration and state.
  </Card>

  <Card title="Player events" icon="bolt" href="/docs-and-guides/distribution/player/developer-guides/player-events">
    Listen and respond to player lifecycle events.
  </Card>

  <Card title="Programmatic control" icon="circle-play" href="/docs-and-guides/distribution/player/developer-guides/programmatic-control">
    Control playback, navigation, and player behavior from your code.
  </Card>
</CardGroup>

## Getting a player instance

Before you can use the API, you need a reference to the player instance.

**Embed script:**

```html theme={null}
<script async defer
  src="https://proxy.beyondwords.io/npm/@beyondwords/player@latest/dist/umd.js"
  onload="const player = new BeyondWords.Player({
    target: this,
    projectId: YOUR_PROJECT_ID,
    contentId: 'YOUR_CONTENT_ID',
  })">
</script>
```

**NPM:**

```javascript theme={null}
import BeyondWords from '@beyondwords/player';

const player = new BeyondWords.Player({
  target: '#beyondwords-player',
  projectId: YOUR_PROJECT_ID,
  contentId: 'YOUR_CONTENT_ID',
});
```

Once you have a player instance, you can use the properties, events, and methods documented in the sections below.
