UI builder - Studio API
Profiles
To execute Profile APIs, take a look at the examples below:
Api.profile.takeIn("My PageID");
Api.profile('My Profile').takeIn(...);
Api.profile('My Profile', 'My Channel').takeIn(...);
Api.profile('My Profile').channel('My Channel').takeIn(...);
Api.profile('/My Folder/My Profile').takeIn(...);
Api.profile on its own targets the active profile. Calling it with a name looks that profile up in the active profile's folder; starting the argument with / makes it a full path, so Api.profile('/Sports/Football') finds the profile Football in the Sports folder.
Api.profile(...).channel(name) narrows the target to one channel of that profile. A channel target supports every function on this page, not only the set* functions documented on the Channel API page.
Every function on this page is asynchronous and returns a Promise.
Properties
| Property | Type | Description |
|---|---|---|
| name | string | The name of the targeted profile (read-only) |
| path | string | The folder path of the targeted profile (read-only) |
| program | channel target | The profile's program channel, without having to name it (read-only) |
| preview | channel target | The profile's preview channel, without having to name it (read-only) |
Targeting a page in another playlist
Every action below also accepts a playlist and a page: takeIn(page) targets a page in the current playlist, and takeIn(playlist, page) targets a page in the named playlist. The same applies to takeOut, update, continue, trigger, setState and the preview* functions.
takeIn
Take IN a Page by providing the PageID as parameter
Api.profile.takeIn(pageID?: string | number): Promise<any>;
Api.profile.takeIn(playlist: string, pageID: string | number): Promise<any>;
| Parameter | Type | Description |
|---|---|---|
| pageID | string/number | The Page ID of the Page to take IN |
takeOut
Take OUT a Page by providing the PageID as parameter
Api.profile.takeOut(pageID?: string | number): Promise<any>;
| Parameter | Type | Description |
|---|---|---|
| pageID | string/number | The Page ID of the Page to take OUT |
takeOutAll
Takes out every live page on the target channel
Api.profile.takeOutAll(): Promise<any>;
takeOutAllFromAllChannels
Takes out every live page on every channel. This one is only available on the top-level Api.profile, not on a profile or channel target.
Api.profile.takeOutAllFromAllChannels(): Promise<any>;
update
Updates the Page specified in the parameter
Api.profile.update(page?: string | number): Promise<any>;
| Parameter | Type | Description |
|---|---|---|
| pageID | string/number | The Page ID of the Page to Update |
continue
Continues the graphic of the Page specified in the parameter
Api.profile.continue(page?: string | number): Promise<any>;
| Parameter | Type | Description |
|---|---|---|
| pageID | string/number | The Page ID of the Page to Continue |
trigger
Triggers an Action in the Page specified in the parameter
Api.profile.trigger(action: string, page?: string | number): Promise<any>;
| Parameter | Type | Description |
|---|---|---|
| action | string | The Action to be triggered |
| pageID | string/number | The Page ID of the Page where the action is to be triggered |
setState
Sets the state of a page directly, without running a transition
Api.profile.setState(state: 'in' | 'out', page?: string | number): Promise<any>;
| Parameter | Type | Description |
|---|---|---|
| state | string | in or out. Defaults to in when not given. |
| pageID | string/number | The Page ID of the Page whose state to set |
previewIn
Preview IN a Page by providing the PageID as parameter
Api.profile.previewIn(page?: string | number): Promise<any>;
| Parameter | Type | Description |
|---|---|---|
| pageID | string/number | The Page ID of the Page to Preview IN |
previewOut
Preview OUT a Page by providing the PageID as parameter
Api.profile.previewOut(page?: string | number): Promise<any>;
| Parameter | Type | Description |
|---|---|---|
| pageID | string/number | The Page ID of the Page to Preview OUT |
previewUpdate
Updates the preview of the Page specified in the parameter
Api.profile.previewUpdate(page?: string | number): Promise<any>;
| Parameter | Type | Description |
|---|---|---|
| pageID | string/number | The Page ID of the Page Update |
previewContinue
Continues the graphic of the Preview Page specified in the parameter
Api.profile.previewContinue(page?: string | number): Promise<any>;
| Parameter | Type | Description |
|---|---|---|
| pageID | string/number | The Page ID of the Page to Continue |
previewTrigger
Triggers an Action in the Preview Page specified in the parameter
Api.profile.previewTrigger(action: string, page?: string | number): Promise<any>;
| Parameter | Type | Description |
|---|---|---|
| action | string | The Action to be triggered |
| pageID | string/number | The Page ID of the Page to Trigger |
sendCommand
Sends Command to the System provided in the parameter
Api.profile.sendCommand(system: string, command: object | string): Promise<any>;
| Parameter | Type | Description |
|---|---|---|
| system | string | The System where the command is to be sent |
| command | object/string | The command to be sent to the system |
The shape of command depends on the system - a string or array of strings for Viz and CasparCG, an object for Unreal Engine, Pixotope, Singular and OSC. The seven concrete overloads are listed in Classes.
clear
Clears the Layer provided in the Parameter
Api.profile.clear(layer?: string): Promise<any>;
| Parameter | Type | Description |
|---|---|---|
| layer | string | The layer to be cleared |
cleanup
Cleans up the Engine currently in use
Api.profile.cleanup(): Promise<any>;
Unlike the Engine API's cleanup, this one takes no layer.
cache
Cache the Asset/Assets in the path
Api.profile.cache(assets: string | string[], verify?: boolean): Promise<any>;
| Parameter | Type | Description |
|---|---|---|
| assets | string/string[ ] | The Asset/Assets to be cached |
| verify | boolean | Verify the assets are cached rather than assuming |
setActive
Makes the targeted profile the active one
Api.profile.setActive(): Promise<any>;
Warning
setActive accepts a channel argument, but it is discarded before the request is sent and has no effect. Only the profile is switched.