> For a complete documentation index, fetch https://docs.voximplant.ai/llms.txt

# SequencePlayer

## Methods

### addEventListener

Adds a handler for the specified [SequencePlayerEvents](/api-reference/voxengine/sequence-player-events) event. Use only functions as handlers; anything except a function leads to the error and scenario termination when a handler is called.

```ts
addEventListener(event: SequencePlayerEvents | T, callback: (event: _SequencePlayerEvents[T]) => any): void
```

**Parameters**

### addMarker

Adds a playback marker to the specified segment. The `SequencePlayerEvents.PlaybackMarkerReached` event is triggered when the marker is reached.

```ts
addMarker(offset: number, segment: PlaybackParameters): void
```

**Parameters**

### id

Returns the sequence player's id.

```ts
id(): string
```

### pause

Pauses playback. To continue the playback use the `SequencePlayer.resume` method.

```ts
pause(): void
```

### removeEventListener

Removes a handler for the specified [SequencePlayerEvents](/api-reference/voxengine/sequence-player-events) event.

```ts
removeEventListener(event: SequencePlayerEvents | T, callback?: (event: _SequencePlayerEvents[T]) => any): void
```

**Parameters**

### resume

Resumes playback after the `SequencePlayer.pause` method is called.

```ts
resume(): void
```

### sendMediaTo

Starts sending media from the sequence player to the media unit.

```ts
sendMediaTo(mediaUnit: VoxMediaUnit, parameters?: SendMediaParameters): void
```

**Parameters**

### stop

Stops playback. The current sequence player's instance with all its segments is destroyed.

```ts
stop(): void
```

### stopMediaTo

Stops sending media from the sequence player to the media unit.

```ts
stopMediaTo(mediaUnit: VoxMediaUnit): void
```

**Parameters**