---
url: https://docs.moqtail.dev/ts/api/client/classes/LiveTrackSource.md
---
# Class: LiveTrackSource

## Implements

* [`LiveObjectSource`](../interfaces/LiveObjectSource.md)

## Constructors

### Constructor

> **new LiveTrackSource**(`stream`): `LiveTrackSource`

#### Parameters

##### stream

`ReadableStream`<[`MoqtObject`](../../model/classes/MoqtObject.md)>

#### Returns

`LiveTrackSource`

## Properties

### stream

> `readonly` **stream**: `ReadableStream`<[`MoqtObject`](../../model/classes/MoqtObject.md)>

Continuous stream yielding objects as they are produced

#### Implementation of

[`LiveObjectSource`](../interfaces/LiveObjectSource.md).[`stream`](../interfaces/LiveObjectSource.md#stream)

## Accessors

### largestLocation

#### Get Signature

> **get** **largestLocation**(): [`Location`](../../model/classes/Location.md) | `undefined`

Highest (latest) location observed so far; undefined until first object

##### Returns

[`Location`](../../model/classes/Location.md) | `undefined`

Highest (latest) location observed so far; undefined until first object

#### Implementation of

[`LiveObjectSource`](../interfaces/LiveObjectSource.md).[`largestLocation`](../interfaces/LiveObjectSource.md#largestlocation)

## Methods

### onDone()

> **onDone**(`listener`): () => `void`

Register a listener invoked when the live stream ends (normal or error). Returns an unsubscribe function.

#### Parameters

##### listener

() => `void`

#### Returns

() => `void`

#### Implementation of

[`LiveObjectSource`](../interfaces/LiveObjectSource.md).[`onDone`](../interfaces/LiveObjectSource.md#ondone)

***

### onNewObject()

> **onNewObject**(`listener`): () => `void`

Register a listener invoked (async) for each new object. Returns an unsubscribe function.

#### Parameters

##### listener

(`obj`) => `void` | `Promise`<`void`>

#### Returns

() => `void`

#### Implementation of

[`LiveObjectSource`](../interfaces/LiveObjectSource.md).[`onNewObject`](../interfaces/LiveObjectSource.md#onnewobject)

***

### stop()

> **stop**(): `void`

Stop ingestion and release underlying reader (idempotent).

#### Returns

`void`

#### Implementation of

[`LiveObjectSource`](../interfaces/LiveObjectSource.md).[`stop`](../interfaces/LiveObjectSource.md#stop)
