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

> **eachClient**(`player`, `attach`): () => `void`

Runs `attach` on the player's current client and on every later one (reconnects replace it),
calling the cleanup `attach` returned for the one before. Returns the function that stops.

## Parameters

### player

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

### attach

(`client`) => () => `void`

## Returns

() => `void`
