Interface: CatalogElement
The catalog element, emitted with the player's catalog event.
Extends
Implements
Properties
context
protectedreadonlycontext:ElementContext
Inherited from
definition
readonlydefinition:ElementDefinition
Set by defineElement once init resolves, so it can't be used from a constructor.
Inherited from
namespace
readonlynamespace:Tuple
The catalog track's namespace.
Implementation of
CatalogReader.namespace
pads
readonlypads:Pad[] =[]
Inherited from
url
readonlyurl: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
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()
protectedcreatePad(direction,capabilities):Pad
Creates a pad and emits padadded.
Parameters
direction
"sink" | "src"
capabilities
Returns
Inherited from
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
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
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()
protectedmatchesCapabilities(pad):boolean
True if the pad matches one of the definition's in capability bundles.
Parameters
pad
Returns
boolean
Inherited from
SourceElement.matchesCapabilities
negotiate()?
optionalnegotiate(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
Returns
boolean
Inherited from
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
Returns
void
Inherited from
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
Returns
void
Inherited from
receive()?
optionalreceive(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
item
Returns
void | Promise<void>
Inherited from
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()
protectedremovePad(pad,failed?):void
Removes a pad and emits padremoved. Pass failed when a failure, not a catalog update, lost it.
Parameters
pad
failed?
boolean = false
Returns
void
Inherited from
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