Skip to content

Studio Script Reference: Internals

Use these properties and functions at your own risk. They are used by the Studio engine internally and may change without warning.

context.activeScene

If a scene is set as active, this property exposes the full scene object. There can only be one active scene at a time, or no active scene.

Type: object

Example:

js
{
    "id": "d97613e9-cfda-43b1-8fa5-44392e32194c",
    "lazy": true,
    "name": "Scene",
    "type": "scene",
    "width": 694,
    "device": "iPhoneVideoCrop",
    "height": 390,
    "parent": "04bddfe4-56c4-4eb8-af07-9c86aba629a4",
    "actions": [],
    "opacity": 1,
    "outputs": [],
    "visible": true,
    "children": [],
    "lazyOnce": false,
    "overflow": "hidden",
    "timelines": [],
    "orientation": "landscape",
    "scaleToDevice": false,
    "backgroundColor": "rgba(0, 0, 0, 0)",
    "keepAspectRatio": false,
    "scaleToDeviceMax": 10,
    "scaleToDeviceMin": 0
}

context.application

The entire internal Studio UI configuration represented as a JSON object. This is the raw application payload as stored and served by Ease Live.

Type: object

Example:

js
{
  id: '6c92994c-6b17-4905-8481-e09cd779a72c',
  name: 'My Project',
  children: [ /* data sources, scenes, ... */ ],
  functions: { children: [ /* function sets */ ] },
  groups: [ /* package groups */ ],
  // ...
}

context.definitions

The key is the UUID representing the Data source definition in the Studio JSON object, and the value is a BaseDataSource runtime instance responsible for handling the logic of a data source in Studio.

Type: Object { [key: string]: BaseDataSource }

context.flatNodes

This is a flat map representation of all nodes in the Studio JSON object. You can lookup any node with an object key match if you have the UUID available for the node you're looking for.

Type: Object { [key: string]: Node }

Example:

js
{
    "e6615b6a-4af4-43fb-b2d8-f167d6506e45": { ... },
    "0b2a9a31-ffe1-4284-b0c8-334dc7f4bf64": { ... },
    "a4490d89-3363-4e8a-8622-f9702d43e272": { ... }
}

context.nextTick()

Utility for waiting for the next DOM update flush.

Imported from Vue.

When you mutate reactive state in Vue, the resulting DOM updates are not applied synchronously. Instead, Vue buffers them until the "next tick" to ensure that each component updates only once no matter how many state changes you have made.

nextTick() can be used immediately after a state change to wait for the DOM updates to complete. You can either pass a callback as an argument, or await the returned Promise.

Type: function nextTick(callback?: () => void): Promise

Example:

js
// DOM not yet updated
await nextTick()
// DOM is now updated

context.reactiveDelete()

Reactively deletes a property from a Vue reactive object. Wraps Vue's del to ensure reactivity is preserved.

Type: function(target: object, key: string): void

Example:

js
context.reactiveDelete(context.sources.MyState, 'myProp');

context.reactiveSet()

Reactively adds or updates a property on a Vue reactive object. Wraps Vue's set to ensure reactivity is properly initialized even for new keys.

Type: function(target: object, key: string, value: any): void

Example:

js
context.reactiveSet(context.sources.MyState, 'myProp', 42);

context.stream

The current stream context, used internally for timecode offset resolution.

Type: object

Example:

js
{
  id: 'main' // stream identifier, defaults to 'main'
}