Skip to content

DocumentService

Defined in: relay-sdks/ts/src/document-service.ts:40

Serves a state-shaped track whose document the application replaces, such as the media timeline. Create one with createDocumentService.

readonly document: Uint8Array<ArrayBufferLike> | undefined;

Defined in: relay-sdks/ts/src/document-service.ts:44

The latest document, or undefined before the first.


readonly failures: number;

Defined in: relay-sdks/ts/src/document-service.ts:33

Writes that failed while the track stayed open, each followed by a retry or by lost demand.

CatalogService.failures


readonly sends: number;

Defined in: relay-sdks/ts/src/document-service.ts:31

Documents the transport accepted.

CatalogService.sends

serve(options?): Promise<void>;

Defined in: relay-sdks/ts/src/document-service.ts:29

Run until the signal aborts or the track ends. Resolves when the track ends without a write having failed. Rejects with the RelayError that ended the track when a write exposed it, so a retired catalog cannot go unnoticed.

Parameter Type
options? ServeOptions

Promise<void>

CatalogService.serve


update(document): void;

Defined in: relay-sdks/ts/src/document-service.ts:42

Replace the document, and send it if the relay is subscribed. Returns at once.

Parameter Type
document ArrayBufferView

void