Skip to content

Output Object

Properties

Name Type Description Example
id String id of the output "-M6lIq_2TvSmz4cfTSNY"
name String name of the output "Default"

Methods

The subcomposition object has following methods:

Method Return type Brief description
getComposition() object Returns the composition loaded to an output
getUrl() url Returns the output URL of an output
setComposition( composition ) - Load a composition into an output

getComposition()

Returns the composition loaded to an output.

1
2
3
4
5
// The code below prints the composition object to the console
var outputId = "-M6lIq_2TvSmz4cfTSNY";
var outputObject = singularApp.getOutputById(outputId);
var compositionObject = outputObject.getComposition();
console.log("compositionObject =", compositionObject);

Return

object - Composition object

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
compositionObject:
> getControlNode: ƒ getControlNode()
> getLogicLayer: ƒ getLogicLayer()
> getModel: ƒ getModel()
> getPayload: ƒ getPayload()
> getRefId: ƒ getRefId()
> getSequencer: ƒ getSequencer()
> getState: ƒ getState()
> getSubcompositionById: ƒ getSubcompositionById(id)
> getSubcompositionByName: ƒ getSubcompositionByName(name)
> id: "303798-latest-1589207585405"
> jumpTo: ƒ jumpTo(to)
> listSubcompositions: ƒ listSubcompositions()
> name: "Default"
> playTo: ƒ playTo(to)
> remove: ƒ remove(callback)
> resetAllPayloads: ƒ resetAllPayloads()
> resetPayload: ƒ resetPayload()
> setPayload: ƒ setPayload(payload)

See also

composition object

getUrl()

Returns the output URL of an output

1
2
3
4
5
// The code below prints the output URL to the console
var outputId = "-M6lIq_2TvSmz4cfTSNY";
var outputObject = singularApp.getOutputById(outputId);
var outputURL = outputObject.getUrl();
console.log("outputURL =", outputURL);

Return

string - Output URL

1
outputURL = https://app.singular.live/appinstances/388278/outputs/Default/onair

setComposition( composition )

Load the composition object composition into the output.

Parameters

Name Type Description
composition object Composition object
1
2
3
4
// The code below loads the composition 'compositionObject' into the output
var outputId = "-M6lIq_2TvSmz4cfTSNY";
var outputObject = singularApp.getOutputById(outputId);
outputObject.setComposition(compositionObject);

Return

none