Skip to content

Reference

The reference documentation provided in the following sections describes the App SDK structure and App SDK methods.

Methods

Method Return type Brief description
ServerDate() object Returns the object to request time details from the Singular server
audioBrowserEventCallback( windowParent, callback ) - Callback function to handle audio browser events
compositionBrowserEventCallback( windowParent, callback ) - Callback function to handle composition browser events
createSingularForm( window, dom, controlNode, callback, options ) - Create Singular fill-in form for the defined control node
destroySingularForm( dom ) - Destroy Singular fill-in form
getAppInstanceInfo() object Makes a request to get app instance details
getAudioBrowserUrl() url Returns URL to the Singular audio browser
getCompositionBrowserUrl() url Returns URL to the Singular composition browser
getCompositionById( id ) object Returns tge composition object that is requested by its id
getCompositionByName( name ) object Returns the composition object that is requested by its name
getCompositionUrl( comp ) url Returns URL to the JSON description of the composition
getImageBrowserUrl() url Returns URL to the Singular image browser
getOutputById( id ) object Returns the output that is requested by its id
getOutputByName( name ) object Returns the output that is requested by its name
imageBrowserEventCallback( windowParent, callback ) object Callback function to handle image browser events
importComposition( comp, callback ) - Import composition into the app instance
listCompositions() object Returns an array of composition names and ids
listIdsByName( array, name ) object Returns the matching id to a name in an array
listOutputs() object Returns an array of output names and ids
registerWindow( window ) - Register browser window
removeAllCompositions( callback ) - Remove all compsitions from the app instance
removeCompositionById ( id, callback ) - Remove compsitions by id from the app instance
removeCompositionByName ( name, callback ) - Remove compsitions by id from the app instance
removeSingularForm() - Remove Singular fill-in form
renderSingularForm() - Render Singular fill-in form
storage object Returns storage object for syncing data between app instance UIs

Detailed documentation

ServerDate()

Returns the object to request time details from the Singular server. ServerDate() is required for synchronizing clocks and timers between in the app instance, and the overlay.

Return

object - ServerDate object

1
2
3
ServerDate: ƒ ServerDate()
> getOffset: ƒ ()
> now: ƒ ()

See also

ServerDate object

audioBrowserEventCallback( windowParent, callback )

Register callback function for the audio browser select event.

compositionBrowserEventCallback( windowParent, callback )

Register callback function for the composition browser select event.

createSingularForm( window, dom, controlNode, callback, options )

Create a Singular fill-in-form.

destroySingularForm( dom )

Distroy Singular fill-in-form.

getAppInstanceInfo()

Makes a request to get app instance details

1
2
3
// The code below prints the app instance info to the console
var appInstanceInfo = singularApp.getAppInstanceInfo();
console.log("appInstanceInfo =", appInstanceInfo);

Return

object - app instance information as JSON object

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
{
  "account_id": 1,
  "apptemplate": {
    "id": 347,
    "name": "tm-Lower Third",
    "version": 1
  },
  "fid": "5dab1a49-3a18-4287-856f-5041bde364e9",
  "iLog": 0,
  "id": 377711,
  "name": "tm-Lower Third",
  "noHeader": 0,
  "tenant": null,
  "theme": "",
  "uiLayout": ""
}

getAudioBrowserUrl()

Returns URL to the Singular audio browser

1
2
3
// The code below prints the audio browser URL to the console
var audioBrowserUrl = singularApp.getAudioBrowserUrl();
console.log("audioBrowserUrl =", audioBrowserUrl);

Return

string - audio browser URL

1
audioBrowserUrl = https://app.singular.live/externals/browser?type=audio&showSearch=true&showHeader=true

getCompositionBrowserUrl()

Returns URL to the Singular composition browser

1
2
3
// The code below prints the composition browser URL to the console
var compositionBrowserUrl = singularApp.getCompositionBrowserUrl();
console.log("compositionBrowserUrl =", compositionBrowserUrl);

Return

string - composition browser URL

1
compositionBrowserUrl = https://app.singular.live/externals/browser?showSearch=true&showHeader=true

getCompositionById( id )

Returns the composition object that is requested by its id

Parameters

Name Type Description
id String Id of the composition
1
2
3
4
// The code below prints the composition object to the console
var compositionId = "303798-latest-1588928586739";
var compositionObject = singularApp.getComposition(compositionId);
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

getCompositionByName( name )

Returns the composition object that is requested by its name

Parameters

Name Type Description
id String Id of the composition
1
2
3
4
// The code below prints the composition object to the console
var compositionName = "Default";
var compositionObject = singularApp.getCompositionByName(compositionName);
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
20
compositionObject:
> getControlNode: ƒ getControlNode()
> getLogicLayer: ƒ getLogicLayer()
> getModel: ƒ getModel()
> getPayload: ƒ getPayload()
> getRefId: ƒ getRefId()
> getSequencer: ƒ getSequencer()
> getState: ƒ getState()
> getSubcomposition: ƒ getSubcompositionById(id)
> 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

getCompositionUrl( composition )

Returns URL to the JSON description of the composition

Parameters

Name Type Description
composition object composition object
1
2
3
// The code below prints the image browser URL to the console
var compositionUrl = singularApp.getCompositionUrl(singularApp.getCompositionByName("Default"));
console.log("compositionUrl =", compositionUrl);

Return

string - composition URL

1
imageBrowserUrl = https://assets.singular.live/f12f184c9a0eb763beb40478e02a1250/jsons/1BRahf3g9F8bMJleFx5nqQ.json

getImageBrowserUrl()

Returns URL to the Singular image browser

1
2
3
// The code below prints the image browser URL to the console
var imageBrowserUrl = singularApp.getImageBrowserUrl();
console.log("imageBrowserUrl =", imageBrowserUrl);

Return

string - image browser URL

1
imageBrowserUrl = https://app.singular.live/externals/browser?type=image&showSearch=true&showHeader=true

getOutputById( id )

Return output object defined by id

Parameters

Name Type Description
id string Id of the output
1
2
3
4
// The code below prints the output object to the console
var outputId = "-M6lIq_2TvSmz4cfTSNY";
var outputObject = singularApp.getOutputById(outputId);
console.log("outputObject =", outputObject);

Return

object - output object

1
2
3
4
5
6
outputObject
> getComposition: ƒ output_getComposition(),
> getUrl: ƒ getUrl(),
> id: "-M6lIq_2TvSmz4cfTSNY",
> name: "Default",
> setComposition: ƒ output_setComposition(comp)

See also

output object

getOutputByName( name )

Return output object defined by name

Parameters

Name Type Description
name String Name of the composition
1
2
3
4
// The code below prints the output object to the console
var outputName = "Default";
var outputObject = singularApp.getOutputByName(outputName);
console.log("outputObject =", outputObject);

Return

object - output object

1
2
3
4
5
6
outputObject
> getComposition: ƒ output_getComposition(),
> getUrl: ƒ getUrl(),
> id: "-M6lIq_2TvSmz4cfTSNY",
> name: "Default",
> setComposition: ƒ output_setComposition(comp)

See also

output object

imageBrowserEventCallback( windowParent, callback )

Register callback function for the image browser select event.

importComposition( comp, callback )

Import composition into the app instance.

listCompositions()

Returns an array of composition names and ids

1
2
3
// The code below prints the audio browser URL to the console
var compositionList = singularApp.listCompositions();
console.log("compositionList =", compositionList);

Return

object - Array of JSON objects

1
[ "0" { "name": "Default", "id": "303798-latest-1588891446073" } ]

listIdsByName( array, name )

Add description here ...

listOutputs()

Returns an array of output names and ids

1
2
3
// The code below prints the audio browser URL to the console
var outputList = singularApp.listOutputs();
console.log("outputList =", outputList);

Return

object - Array of JSON objects

1
[ "0" { "name": "Default", "id": "-M6lIq_2TvSmz4cfTSNY" } ]

registerWindow( window )

Register window for Singular browsers.

removeAllCompositions( callback )

Remove all compositions from the app instance.

removeCompositionById ( id, callback )

Remove a composition by it's id.

removeCompositionByName ( name, callback )

Remove a composition by it's name.

removeSingularForm()

Remove Singular fill-in-form from the dom.

renderSingularForm()

Show Singular fill-in-form in the name.

storage

Singular storage object

Return

object - storage object

1
2
3
4
5
6
7
storage object:
> get: ƒ (key,callback),
> off: ƒ off(key,cb),
> on: ƒ on(key,cb),
> remove: ƒ remove(key,callback),
> set: ƒ (key,data,callback),
> update: ƒ update(key,data,callback)

See also

storage object