Add a layer to an existing scene
livereacting_add_layerAdd one layer to a scene that already exists. Three types can be created: "videoPlaylist" and "audioPlaylist", which hold a list of files, and "video", which holds a single file. Text, image and interactive layers are readable with livereacting_get_layer but can only be created in the LiveReacting Studio. Use this to put a playlist into a scene that has none -- for example a scene made by livereacting_manage_scene, or a background music track alongside a video playlist. For a NEW scene and its playlist together use livereacting_create_scene_with_playlist instead; that tool also wires the auto-switch that chains a 24/7 channel. For a video or audio playlist, loop defaults to true; pass loop: false for a clip that must play once. The settings are read strictly by type, and the wrong ones are dropped without an error: a "video" layer ignores files, and a playlist layer ignores fileId. settings.files is optional, so a playlist created without it is created empty; send the files here, or fill the layer afterwards with livereacting_set_playlist. If autoSynch is on and the project is streaming, this copies the full saved project configuration to the running stream. It can overwrite changes made only to the live stream, including settings of existing layers. This is NOT idempotent: calling it twice adds two layers. After a timeout, read the scene with livereacting_get_scenes to see whether the layer arrived, rather than calling again. To change a playlist afterwards use livereacting_set_playlist.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Name for the layer, 19 characters or less. Defaults to a name for the type. | |
| type | Yes | "videoPlaylist" and "audioPlaylist" play a list of files; "video" plays one file. | |
| sceneId | Yes | The scene to add the layer to, from livereacting_get_scenes. | |
| settings | No | What the layer plays. The fields differ by type -- see each one. | |
| projectId | Yes | Project id, from livereacting_list_projects. |