# Enabling package to use playlist from assets

**URL:** <https://community.info-beamer.com/t/enabling-package-to-use-playlist-from-assets/1261>\
**Category:** Help\
**Created:** [January 11, 2024, 12:46pm UTC](https://community.info-beamer.com/t/enabling-package-to-use-playlist-from-assets/1261 "2024-01-11T12:46:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tim](https://community.info-beamer.com/letter_avatar_proxy/v3/letter/t/ce73a5/32.png) [@tim](https://community.info-beamer.com/u/tim)\
**Post date:** [January 11, 2024, 12:46pm UTC](https://community.info-beamer.com/t/enabling-package-to-use-playlist-from-assets/1261/1 "2024-01-11T12:46:40Z")

</div>

Hi there Florian!

I’m hoping for a quickstart guide on how I can give my node.lua file access to a playlist of assets i’ve created in the assets tab.

I understand i have to setup options in the node.json file, and somehow i’ll then be able to reference the playlist and the assets within it within the node.lua program… but i’m a bit stuck on the syntax of what i need to add to the node.json file. Any help and/or code examples would be much appreciated.

Thanks!

Tim

---

<div class="post-metadata">

**Author:** ![infobeamer-fw](https://community.info-beamer.com/user_avatar/community.info-beamer.com/infobeamer-fw/32/3_2.png) [@infobeamer-fw](https://community.info-beamer.com/u/infobeamer-fw)\
**Post date:** [January 11, 2024, 2:16pm UTC](https://community.info-beamer.com/t/enabling-package-to-use-playlist-from-assets/1261/2 "2024-01-11T14:16:03Z")

</div>

First you need a list of items in `node.json` like this:

```JSON
{
    "title": "Playlist",
    "name": "playlist",
    "type": "list",
    "itemname": "Item",
    "items": [{
        "title": "Asset",
        "ui_width": 8,
        "name": "asset",
        "type": "resource",
        "valid": ["image", "video"],
        "default": "empty.png"
    }, {
        "title": "Play time (in seconds)",
        "ui_width": 4,
        "name": "duration",
        "type": "duration",
        "default": 10
    }]
}

```

The name of the playlist (`"playlist"` in this example) is up to you, but is later used in the generated `config.json` on the device. The `"items"` value needs some special requirements to make such a list “playlist-compatible”. Namely one entry called `"asset"` and one named `"duration"`. If both of those are included as properties of a list’s item description, the configuration UI on the dashboard will allow you to easily use assets or [native playlists](https://info-beamer.com/playlists) when filling that playlist.

If you create a setup based on such a package, the `config.json` file generated and synced to the device now contains the configured assets like this:

```json
  ... 
  "playlist": [
    {
      "duration": 10,
      "asset": {
        "asset_id": 12345,
        "asset_name": "asset-d8e8fca2dc0f896fd7cb4cb0031ba249-asset-filename.jpg",
        "filename": "asset-filename.jpg",
        "metadata": {
          "format": "jpeg",
          "height": 1080,
          "width": 1920
        },
        "tags": [],
        "type": "image"
      }
    }, [... possibly more assets...]
  ],
  ...

```

Once the `config.json` file is updated (you can detect that with [util.json\_watch](https://info-beamer.com/doc/info-beamer#util.json_watch)), you are guaranteed that the asset files referenced by `"asset_name"` are also already available for use on the device.

Hope that help.
