Skip to content

Interface: CatalogElement ​

The catalog element, emitted with the player's catalog event.

Extends ​

Implements ​

Properties ​

context ​

protected readonly context: ElementContext

Inherited from ​

SourceElement.context


definition ​

readonly definition: ElementDefinition

Set by defineElement once init resolves, so it can't be used from a constructor.

Inherited from ​

SourceElement.definition


namespace ​

readonly namespace: Tuple

The catalog track's namespace.

Implementation of ​

CatalogReader.namespace


pads ​

readonly pads: Pad[] = []

Inherited from ​

SourceElement.pads


url ​

readonly url: string

The catalog's session URL, moqt://authority/path[?query] without a fragment.

Implementation of ​

CatalogReader.url

Accessors ​

duration ​

Get Signature ​

get duration(): number

Seconds: the longest trackDuration of the loaded sources' tracks, Infinity while live, NaN unknown.

Returns ​

number


isComplete ​

Get Signature ​

get isComplete(): boolean

Returns ​

boolean

Implementation of ​

CatalogReader.isComplete


json ​

Get Signature ​

get json(): object & object | undefined

The last good catalog document, deltas applied and variables substituted.

Returns ​

object & object | undefined


publishTracks ​

Get Signature ​

get publishTracks(): readonly (object & object & object)[]

Returns ​

readonly (object & object & object)[]


stale ​

Get Signature ​

get stale(): boolean

An update was missed or rejected since the last good catalog.

Returns ​

boolean


streamType ​

Get Signature ​

get streamType(): StreamType

From the tracks of the loaded sources.

Returns ​

StreamType


tracks ​

Get Signature ​

get tracks(): readonly (object & object & object)[]

The last good catalog's tracks, roles inferred.

Returns ​

readonly (object & object & object)[]

Implementation of ​

CatalogReader.tracks

Methods ​

byRole() ​

byRole(role): (object & object & object)[]

Parameters ​

role ​

string

Returns ​

(object & object & object)[]


createPad() ​

protected createPad(direction, capabilities): Pad

Creates a pad and emits padadded.

Parameters ​

direction ​

"sink" | "src"

capabilities ​

Capabilities

Returns ​

Pad

Inherited from ​

SourceElement.createPad


destroy() ​

destroy(): Promise<void>

Removes the element's pads. The runtime aborts context.signal before and releases the elements this one loaded after. Override for your own cleanup and call super.destroy().

Returns ​

Promise<void>

Overrides ​

SourceElement.destroy


emit() ​

emit<K>(event, ...args): void

Calls every listener of event with args. Allocates nothing when there are none.

Type Parameters ​

K ​

K extends "ready" | "padadded" | "padremoved" | "nomorepads"

Parameters ​

event ​

K

args ​

...Parameters<ElementEvents[K]>

Returns ​

void

Inherited from ​

SourceElement.emit


find() ​

find(name, namespace?): object & object & object | undefined

A track by name bytes, in the catalog's namespace unless given (MSF 11.2.2).

Parameters ​

name ​

string | Uint8Array<ArrayBufferLike>

namespace? ​

Tuple = ...

Returns ​

object & object & object | undefined


matchesCapabilities() ​

protected matchesCapabilities(pad): boolean

True if the pad matches one of the definition's in capability bundles.

Parameters ​

pad ​

Pad

Returns ​

boolean

Inherited from ​

SourceElement.matchesCapabilities


negotiate()? ​

optional negotiate(pad): boolean

Optional: whether to take a source pad of an element this one loaded. A taken pad connects to a new sink pad here instead of reaching the sinks, and its items arrive through receive().

Parameters ​

pad ​

Pad

Returns ​

boolean

Inherited from ​

SourceElement.negotiate


off() ​

off<K>(event, listener): void

Removes listener, the same function given to on(), from event.

Type Parameters ​

K ​

K extends "ready" | "padadded" | "padremoved" | "nomorepads"

Parameters ​

event ​

K

listener ​

ElementEvents[K]

Returns ​

void

Inherited from ​

SourceElement.off


on() ​

on<K>(event, listener): void

Adds listener for event. Adding the same function twice has no effect.

Type Parameters ​

K ​

K extends "ready" | "padadded" | "padremoved" | "nomorepads"

Parameters ​

event ​

K

listener ​

ElementEvents[K]

Returns ​

void

Inherited from ​

SourceElement.on


receive()? ​

optional receive(pad, item): void | Promise<void>

Called once per item on a taken pad; the pad's next item waits for the returned promise.

Parameters ​

pad ​

Pad

item ​

PadItem

Returns ​

void | Promise<void>

Inherited from ​

SourceElement.receive


references() ​

references(): (object & object & object)[]

Tracks referencing other catalogs (MSF 5.6.16); loading one is up to the user.

Returns ​

(object & object & object)[]


removePad() ​

protected removePad(pad, failed?): void

Removes a pad and emits padremoved. Pass failed when a failure, not a catalog update, lost it.

Parameters ​

pad ​

Pad

failed? ​

boolean = false

Returns ​

void

Inherited from ​

SourceElement.removePad


start() ​

start(): Promise<void>

Subscribes, waits for the first catalog with tracks or isComplete, loads the default sources, and emits nomorepads.

Returns ​

Promise<void>

Throws ​

PlayerError CATALOG_TIMEOUT without a usable catalog in time, UNSUPPORTED_SOURCE for an invalid first catalog or one with nothing playable.


timeline() ​

timeline(track): Promise<TimelineReader | undefined>

The track's template, which needs no subscription; else the media timeline track whose depends names the track or its render group (MSF 7.2), loaded once and shared; else undefined. A media timeline that can't be read is a warning, and undefined from then on, so seeks don't wait for it again.

Parameters ​

track ​

object & object & object

Returns ​

Promise<TimelineReader | undefined>

Implementation of ​

CatalogReader.timeline