Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
DocumentaryTube
live streaming

OBS Lua Script to Reload a Playlist After All Videos Finish

For an unchanged VLC playlist, OBS’s Loop Playlist option is the simplest answer. Lua can support custom refresh workflows, but media_ended does not guarantee the whole playlist ended, and updating source settings can interrupt playback.

By DocumentaryTube Team 4 min read
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If you only want the same VLC playlist to repeat, enable Loop Playlist in the OBS VLC Video Source; no Lua script is needed. If you need a custom action when playback ends or want to apply changed playlist settings, Lua can connect to OBS’s media_ended signal and update the source—but that update rebuilds the playlist and can interrupt playback. One important distinction: the signal is not documented as proof that the entire playlist, rather than one item, has finished.

Choose between looping and reloading

What you need Use Trade-off
Repeat the same configured list of videos VLC Video Source with Loop Playlist enabled Built in and simplest; it does not by itself describe a custom workflow for re-reading changed files or settings.
Run a custom action after a media-end event or apply changed playlist settings An OBS Lua callback connected to media_ended, followed by a source settings update if needed More control, but updating settings rebuilds/restarts player handling, and the signal is not documented as a unique whole-playlist boundary.

VLC Video Source supports multiple media files in a playlist, but it appears in OBS only when VLC is installed. OBS’s VLC Video Source guide documents Loop Playlist as the control for restarting a source when it runs out of media, and Shuffle Playlist for changing playback order.

Enable the built-in loop for an unchanged playlist

  1. Install VLC if it is not already installed. Restart OBS after installation if the VLC Video Source is not available.
  2. In OBS, add or select a VLC Video Source and configure its media playlist.
  3. Open the source properties and enable Loop Playlist. Leave Shuffle Playlist disabled if you need the list to play in its configured order.
  4. Test playback through the final item and confirm that the first item starts again. Verify behavior with your installed OBS and VLC versions.

Use Lua when you need a custom end-event workflow

OBS includes Lua scripting through the obslua module. Scripts are managed at Tools > Scripts. OBS’s API exposes source lifecycle signals including media_ended, and Lua can connect callbacks to a signal handler using signal_handler_connect(handler, signal, callback). The OBS documentation provides the ingredients for this pattern, but does not establish a tested, drop-in script for every VLC playlist setup.

Implementation outline

  1. In Tools > Scripts, add a Lua script and identify the VLC Video Source by its exact name in the OBS Sources list. Source names are user-defined, so a script must target the name used in your scene.
  2. Obtain the source and its signal handler, then connect a Lua callback to media_ended. The OBS scripting and API references describe the Lua module and signal connection mechanism: OBS scripting documentation and OBS source API reference.
  3. In the callback, determine whether the event represents the end of the whole playlist or only the current item advancing. Do not treat each media_ended event as a confirmed playlist-end event without checking the behavior in your setup.
  4. If a refresh is required, read the current source settings and preserve the existing playlist array and each entry’s value field unless you intend to replace them. The VLC source implementation consumes a playlist settings array and rebuilds player handling when settings are updated: OBS VLC Video Source implementation.
  5. Update the source only when the callback’s end condition is satisfied. Expect playback to restart or be interrupted: a settings update is not documented as a seamless in-place refresh.
  6. Release source and settings objects according to OBS API ownership requirements. OBS warns that incorrect handling of scripting objects can leak memory or crash OBS; consult the scripting documentation before adapting the pattern.

This is an implementation pattern, not guaranteed copy-and-run code. The exact event sequence and update timing should be tested with your operating system, OBS version, VLC version, and source configuration before relying on it during a live production.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Why a playlist update can restart playback

The VLC source implementation reads playlist settings and rebuilds its media-list player during an update. That makes an update consequential: it can stop and restart player handling rather than simply refreshing a file list without disturbance. If you only want continuous repetition of an unchanged list, the built-in loop avoids adding a settings-update step.

Troubleshoot the common failure modes

  • VLC Video Source is missing: Confirm VLC is installed, then restart OBS and check the source list again.
  • The list does not restart: Reopen source properties and check Loop Playlist. Test the complete playlist, rather than inferring behavior from an individual item ending.
  • The script runs between playlist items: The callback may be receiving an event for each item. Add and verify a condition that distinguishes the intended final-item case; the signal documentation alone does not guarantee that distinction.
  • The refreshed list starts over or playback visibly pauses: This can result from the source update rebuilding player handling. Avoid refreshing on every event, and use Loop Playlist instead if the files and settings have not changed.
  • The callback does nothing: Check that the script targets the exact OBS source name and is connected to that source’s signal handler. Confirm the script is loaded under Tools > Scripts.
  • OBS becomes unstable or resource use grows: Review how the script acquires and releases source and settings objects against the OBS scripting documentation; incorrect ownership handling can cause leaks or crashes.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or let it run in the cloud

If the goal is a YouTube channel that keeps uploaded videos playing as a 24/7 live stream, that is a different workflow from an OBS playlist source. StreamNeo runs the uploaded videos from the cloud, so nothing has to stay on at home. Upload your recording or build a playlist, add your YouTube stream key, and go live. It streams the uploaded file at its original quality up to 4K 60fps for one flat price per slot, and automatically recovers if YouTube drops the stream. The first day is free with no card, and the monthly option is $9.99 per month. StreamNeo is for YouTube streams of uploaded videos, not camera-based broadcasts. See StreamNeo or start the free day.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Screening Room

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.