---
url: https://docs.moqtail.dev/ts/api/player/functions/followData.md
---
# Function: followData()

> **followData**(`player`, `listener`): () => `void`

Calls `listener` with each incoming data event of the player's client, across reconnects, with
the name of the track its stream carries and the stream's header. A stream can open before the
response naming its track, so `track` stays undefined until a later event of that stream.
Streams opened before the call are skipped. Returns the function that stops listening.

## Parameters

### player

[`MOQtailPlayer`](../classes/MOQtailPlayer.md)

### listener

(`event`, `track`, `header`) => `void`

## Returns

() => `void`
