> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pads4.com/llms.txt
> Use this file to discover all available pages before exploring further.

# External playlists

Instead of using a **manually defined playlist**, you can bind your playlist to an **external data source** such as an **SQL Server database, XML file, or Microsoft Excel file**. This allows **real-time data updates** to dynamically control the content displayed.

For more details on **binding an element** to an external data source, refer to **data provider properties** and **working with data providers**.

***

## **XML Structure for External Playlists**

To be recognized by **PADS4**, external playlists must follow a **specific XML structure**. Below is an example:

```xml theme={null}
<?xml version="1.0" encoding="utf-8"?>
<PlayList>
  <PlayListElement ContentType="3" Duration="5000" Effect="999" EffectDuration="1000">Text of the first playlist item</PlayListElement>
  <PlayListElement ContentType="3" Duration="5000" Effect="999" EffectDuration="1000">Text of the second playlist item</PlayListElement>
</PlayList>
```

### **Key Details:**

* Playlist text items can contain **multiple lines**, separated by an **\[Enter]**.
* **Duration** and **EffectDuration** are measured in **milliseconds**.

***

## **Determining the Correct XML Structure**

Each **element type** requires a slightly different **XML format**. To ensure the correct structure, follow these steps:

1. **Insert the element type** that will play the external playlist (e.g., a **video/sound element** for a video playlist).
2. **Manually add sample playlist items** with content similar to what will be in the data source.
3. **Open the playlist window** and retrieve the XML structure.
4. **Copy the XML to the clipboard** and paste it into your data source.
5. **Modify the structure** to meet your exact requirements.

***

## **Playback of External Playlists**

The behavior of an **external playlist** is determined by:

* The **XML structure** provided by the data source.
* The **playlist options** set within the page element.
* The **default duration** and **default transition effects** settings.
* If **data scrolling** is enabled, the **scroll interval property** will also influence playback.

***

## **Storing Playlists in a Column (XML Data Provider Only)**

If you need to store **nested playlists** within an **XML file**, the XML parser may misinterpret the structure. To prevent this, **replace** `<` and `>` with `&lt;` and `&gt;`.

### **Example Corrected XML:**

```xml theme={null}
<?xml version="1.0" encoding="utf-8"?>
<list>
  <item>
    &lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;PlayList&gt;
      &lt;PlayListElement ContentType="3" Duration="5000" Effect="999" EffectDuration="1000"&gt;Text of the first playlist item&lt;/PlayListElement&gt;
      &lt;PlayListElement ContentType="3" Duration="5000" Effect="999" EffectDuration="1000"&gt;Text of the second playlist item&lt;/PlayListElement&gt;
    &lt;/PlayList&gt;
  </item>
</list>
```

***

## **Playlist Enumerations Summary**

### **Content Type Values**

| Value | Description                                                         |
| ----- | ------------------------------------------------------------------- |
| **0** | Content Library Filename (file stored in **PADS4 content library**) |
| **1** | Full file path (file located outside **PADS4 content library**)     |
| **2** | Separator (pause between playlist items)                            |
| **3** | Embedded content (e.g., text)                                       |
| **4** | Hexadecimal content (e.g., **RS-232 commands**)                     |
| **5** | Video stream URL                                                    |

***

### **Effect Values**

| Value   | Description                                                  |
| ------- | ------------------------------------------------------------ |
| **0**   | None                                                         |
| **1**   | Scroll up                                                    |
| **2**   | Scroll down                                                  |
| **3**   | Scroll left                                                  |
| **4**   | Scroll right                                                 |
| **5**   | Horizontal bars                                              |
| **6**   | Vertical bars                                                |
| **7**   | Horizontal blinds                                            |
| **8**   | Vertical blinds                                              |
| **9**   | Expanding rectangle                                          |
| **10**  | Sliced circle                                                |
| **11**  | Random effect                                                |
| **12**  | Fade in                                                      |
| **13**  | Dissolve                                                     |
| **14**  | Flip                                                         |
| **15**  | Shrink to center                                             |
| **16**  | Split horizontally                                           |
| **17**  | Split vertically                                             |
| **18**  | Twister                                                      |
| **19**  | Zoom in                                                      |
| **20**  | Page turn from left                                          |
| **21**  | Page turn from right                                         |
| **22**  | Page turn out to right                                       |
| **23**  | Page turn out to left                                        |
| **24**  | Move over left                                               |
| **25**  | Move over right                                              |
| **26**  | Move over top                                                |
| **27**  | Move over bottom                                             |
| **28**  | Reserved                                                     |
| **29**  | Flush (**HTML5 Viewer effect**)                              |
| **30**  | Vortex (**HTML5 Viewer effect**)                             |
| **31**  | Bounce (**HTML5 Viewer effect**)                             |
| **999** | Default effect (uses **Default Transition Effect** property) |

***

### **Final Notes**

* Using **external playlists** ensures **dynamic content updates** without manual intervention.
* **Data providers** can be used to fetch real-time playlist items.
* Always test your **XML structure** by retrieving a **sample from PADS4** before implementing it in a live environment.
