Class: SstsSource
The switching set source of the ssts() plugin.
Extends
Implements
Constructors
Constructor
new SstsSource(
context,options,preferred):SstsSource
preferred is the plugin's list, most preferred first; the source starts on the first negotiated one.
Parameters
context
options
preferred
readonly bigint[]
Returns
SstsSource
Overrides
Properties
algorithms
readonlyalgorithms: readonlybigint[]
The negotiated algorithms (sstsAlgorithms), most preferred first, read at init.
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
options
readonlyoptions:SwitchingSetOptions
pad
readonlypad:Pad
pads
readonlypads:Pad[] =[]
Inherited from
Accessors
algorithm
Get Signature
get algorithm():
bigint
Returns
bigint
Methods
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>
Inherited from
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
getRenditions()
getRenditions():
Rendition[]
Returns
Implementation of
MediaSourceElement.getRenditions
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()
negotiate():
boolean
The chain only offers pads of elements this one loaded: take them all.
Returns
boolean
Overrides
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
pauseSwitching()
pauseSwitching():
Promise<void>
Pauses automatic switching: activate 0 on the set (SSTS 6.2).
Returns
Promise<void>
receive()
receive(
pad,item):Promise<void>
Called once per item on a taken pad; the pad's next item waits for the returned promise.
Parameters
pad
item
Returns
Promise<void>
Overrides
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
resumeSwitching()
resumeSwitching():
Promise<void>
Resumes automatic switching: activate back to the set size.
Returns
Promise<void>
selectRenditions()
selectRenditions(
renditionIds):Promise<void>
Changes the switching set (SSTS 6.2): a deselected track is unsubscribed, a selected one subscribed again. A single selection keeps every track in the set and pins it by threshold.
Parameters
renditionIds
string[]
Returns
Promise<void>
Implementation of
MediaSourceElement.selectRenditions
setAlgorithm()
setAlgorithm(
id):Promise<void>
Moves the whole set to another negotiated algorithm with a REQUEST_UPDATE per subscription; a rejected update rolls the others back, so the set never carries two algorithms. With concurrent calls the latest wins and earlier ones reject with ABORTED.
Parameters
id
bigint
Returns
Promise<void>
setTracks()
setTracks(
tracks):void
New tracks get a child, selected unless a track is pinned; removed ones are released.
Parameters
tracks
readonly (object & object & object)[]
Returns
void
Implementation of
start()
start():
Promise<void>
Internal
Loads a child per track, in parallel: the publisher activates once all are assigned (SSTS 6.3). The set plays on the children that loaded; it fails only when none did.
Returns
Promise<void>
switch()
switch(
renditionId):Promise<void>
Pins the relay to one track: the same as selecting only it.
Parameters
renditionId
string
Returns
Promise<void>