# PlayoutClock

URL: https://www.caprid.com/docs/reference/typescript/caprid/moq-media/interfaces/playoutclock/

Defined in: [clock.ts:253](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/clock.ts#L253)

A player's clock for one broadcast's timeline. Audio is the master; video asks it when each frame is due.

## Properties

### lateDropUs

```ts
readonly lateDropUs: number;
```

Defined in: [clock.ts:268](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/clock.ts#L268)

How late a frame may be shown, in microseconds: the `lateDropUs` option.

***

### mode

```ts
readonly mode: PlayoutMode;
```

Defined in: [clock.ts:255](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/clock.ts#L255)

What paces the clock now.

***

### resets

```ts
readonly resets: number;
```

Defined in: [clock.ts:274](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/clock.ts#L274)

How many times `reset()` has been called: a frame reader sees from it that the timeline changed under it.

***

### targetLatencyUs

```ts
readonly targetLatencyUs: number;
```

Defined in: [clock.ts:270](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/clock.ts#L270)

The target latency now: the option, or twice the longest of the last four keyframe intervals reported.

## Methods

### due()

```ts
due(timestampUs): PlayoutDecision;
```

Defined in: [clock.ts:264](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/clock.ts#L264)

Decide whether the frame with this timeline timestamp should wait, be shown now, or be dropped.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `timestampUs` | `number` |

#### Returns

[`PlayoutDecision`](https://www.caprid.com/docs/reference/typescript/caprid/moq-media/type-aliases/playoutdecision/)

***

### localNow()

```ts
localNow(): number;
```

Defined in: [clock.ts:276](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/clock.ts#L276)

The clock's local time source now, in microseconds: what a frame reader measures its waits in.

#### Returns

`number`

***

### position()

```ts
position(): number | undefined;
```

Defined in: [clock.ts:266](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/clock.ts#L266)

The timeline position now, or `undefined` while idle.

#### Returns

`number` \| `undefined`

***

### reportAudio()

```ts
reportAudio(timestampUs, atUs?): void;
```

Defined in: [clock.ts:260](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/clock.ts#L260)

Report that the audio with this timeline timestamp is audible at local time `atUs` (default now): what was
handed to the output, less the jitter-buffer depth, `AudioContext.outputLatency`, and any extra path.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `timestampUs` | `number` |
| `atUs?` | `number` |

#### Returns

`void`

***

### reportKeyframeInterval()

```ts
reportKeyframeInterval(intervalUs): void;
```

Defined in: [clock.ts:272](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/clock.ts#L272)

Report the spacing between two consecutive keyframes on the timeline; a frame reader does this.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `intervalUs` | `number` |

#### Returns

`void`

***

### reset()

```ts
reset(): void;
```

Defined in: [clock.ts:281](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/clock.ts#L281)

Forget every anchor, at a Restart, a Move, a resync, or a new catalog: the next frame anchors wall pacing. The
keyframe intervals reported so far are kept.

#### Returns

`void`

***

### stopAudio()

```ts
stopAudio(): void;
```

Defined in: [clock.ts:262](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/clock.ts#L262)

Audio is muted or ended: pace by wall clock from the current position.

#### Returns

`void`
