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

# Player

Amethyst's player will emit these events when things happen

### player:play

Emits only when a song starts playing after being at a **stopped** or **finished** state

```ts theme={null}
amethyst.player.on("player:play", (track: Track) => {});
```

### player:pause

Emits when user pauses playback

```ts theme={null}
amethyst.player.on("player:pause", (track: Track) => {});
```

### player:resume

Emits when user resumes/continues playback

```ts theme={null}
amethyst.player.on("player:resume", (track: Track) => {});
```

### player:stop

Emits when the player has finished playing the queue

<Note>
  This will not emit if looping entire queue is enabled
</Note>

```ts theme={null}
amethyst.player.on("player:resume", (track: Track) => {});
```

### player:seek

Emits when user seeks

```ts theme={null}
amethyst.player.on("player:seek", ({track: Track, seekedTo: number}) => {});
```

### player:trackChange

Emits when user changes the playing track

```ts theme={null}
amethyst.player.on("player:trackChange", (track: Track) => {});
```

### player:trackFinished

Emits when a track has finished playing before switching to the next one

```ts theme={null}
amethyst.player.on("player:trackFinished", ({ track: Track, startTimestamp: number }) => {});
```

### player:pitchChange

Emits when user changes the playback rate / pitch shift (default is 1)

```ts theme={null}
amethyst.player.on("player:pitchChange", ({track: Track, playbackRate: number}) => {});
```

### player:next

Emits when user skips to the next track

<Note>
  [player:trackChange](#player%3Atrackchange) will also emit alongside this
</Note>

```ts theme={null}
amethyst.player.on("player:next", (track: Track) => {});
```

### player:previous

Emits when user skips to the previous track

<Note>
  [player:trackChange](#player%3Atrackchange) will also emit alongside this
</Note>

```ts theme={null}
amethyst.player.on("player:previous", (track: Track) => {});
```

### player:volumeChange

Emits when user changes the playback volume

```ts theme={null}
amethyst.player.on("player:volumeChange", (dB: number) => {});
```

### player:currentTrackMetadataLoaded

Emits when the metadata for the currently playing track has finished loading

```ts theme={null}
amethyst.player.on("player:currentTrackMetadataLoaded", (track: Track) => {});
```
