# Replay: pause() method

> The pause() method of the Replay interface stops playback at the tick shown.

The **`pause()`** method of the [`Replay`](/docs/client/replay) interface stops playback at the tick shown.

## Syntax

```ts
pause()
```

### Parameters

None.

### Return value

None (`undefined`).

### Exceptions

None.

## Description

The replay keeps showing the tick it paused at, and [`play()`](/docs/client/replay/play) carries on from there. `pause()` does nothing while the replay isn't playing.

## Examples

### Pausing when the tab is hidden

A replay viewer pauses when the player switches tabs, and resumes when they come back if it was playing.

```ts
// hidden-pause.ts
import type { Replay } from "@irtio/client/replay";

export function pauseWhenHidden(replay: Replay): void {
  let resume = false;
  document.addEventListener("visibilitychange", () => {
    if (document.hidden) {
      resume = replay.playing;
      replay.pause();
    } else if (resume) {
      replay.play();
    }
  });
}
```

## See also

- [`Replay.play()`](/docs/client/replay/play)
- [`Replay.seek()`](/docs/client/replay/seek)
