Replace a playlist
livereacting_set_playlistReplace the entire contents of a video or audio playlist layer. The files you send become the whole playlist: anything already in it that you do not send again is removed, and playback restarts from the first item. There is no way to append with this tool. So to add, remove or reorder a video, first call livereacting_get_layer and page through every item until nextOffset is null, apply your change to that complete list, and send the complete list back. Sending only the new video deletes everything else. The response reports removedItemCount and warns whenever the playlist got shorter — check it before telling the customer the change worked. Writes are not merged. If two callers write the same playlist at once, the later write replaces the earlier one and both report success, so do not run parallel edits against one playlist. If the customer may be editing it in the LiveReacting Studio at the same moment, read the list again immediately before writing, and tell them not to edit while you work. Files must have finished importing and encoding. A playlist holds at most 600 items. This tool works on videoPlaylist and audioPlaylist layers only. This is NOT idempotent: sending the same list twice produces the same contents, but each call regenerates every playlistItemId and restarts playback. After a timeout, read the layer with livereacting_get_layer rather than calling again.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| loop | No | Repeat the playlist forever. Refused while the layer auto-switches into another scene, unless the same call also sends autoSwitchToSceneId: null. | |
| files | Yes | The COMPLETE playlist in play order. This replaces the current list. An empty array empties the playlist. | |
| volume | No | Playback volume, 0 to 10. | |
| layerId | Yes | Playlist layer id, from livereacting_get_scenes. | |
| projectId | Yes | Project id, from livereacting_list_projects. | |
| autoSwitchToSceneId | No | What happens when the playlist ends. A scene id (from livereacting_get_scenes) makes it switch to that scene and turns loop off. null removes the switch, so send loop: true with it to make the playlist repeat instead. Leave it out to keep the current setting. |