Build from source or use a community package (e.g., via OBS’s obs-plugins repository).
There are a few variations of this concept (e.g., “obs- playlist,” “Advanced Scene Switcher” with media lists, or “StreamFX” playlist-like features). This post focuses on the dedicated obs-playlist plugin by exeldro (a known OBS plugin developer).
The script works by manipulating the properties of a in real-time.