Guideexamples/vlc_auto_player.py

Can you use a computer monitor as a TV? If a PC is driving it, you can skip every adapter the other guides tell you to buy.

Every top-ranked result answers this question the same way: buy a streaming stick, plug in a set-top box, or wire up a coax-to-HDMI tuner. All correct if your monitor is sitting alone in a spare room. The far more common case (a monitor already connected to a computer) needs none of that. Your computer is the tuner. A 151-line script in the Terminator repo turns your AI coding assistant into the remote.

M
Matthew Diakonov
8 min read
4.9from 2.1k stars on GitHub
Windows UIA + macOS AX
151-line runnable example
MIT licensed

What every top SERP result agrees on, and what they all skip

PCWorld, TCL, Digital Trends, TechFinitive, and Lenovo all answer the question the same way. Yes you can use a computer monitor as a TV, now here is the shopping list. Buy a streaming stick like a Fire Stick or a Chromecast. Or a set-top box. Or a coax-to-HDMI tuner if you want over-the-air channels. Then deal with the audio problem because monitors rarely have speakers.

All correct in the narrow case where the monitor is the only hardware you own. But the far more common case is a monitor that already has a PC plugged into it. In that case the PC is a complete tuner: CPU, network, audio out, disk, and the ability to run any media player you want. The only thing missing is a clean, hands-free way to tell that media player what to play.

The other guides vs a PC with Terminator

Pick the right streaming stick. Run an HDMI cable. Find an unused port. Buy USB speakers for audio. Pair a separate Bluetooth remote. Keep a TV-only account on Netflix so your YouTube history does not get polluted.

  • At least one extra purchase
  • A second set of credentials
  • Audio workaround required
  • A physical remote to lose

The signal path you build when the computer is the tuner

One request arrives, one stream plays. The path from an AI agent saying "turn on the lofi channel" to your monitor displaying video goes through exactly four pieces: Terminator, the OS accessibility tree, VLC, and the panel.

AI assistant to monitor, four hops

AI coding assistant
vlc_auto_player.py
Terminator SDK
OS accessibility tree
VLC
Your monitor

The exact four accessibility calls that do the work

This is the whole flow, condensed. No DOM scraping, no pixel matching, no fragile image recognition. Four selector lookups against the Windows UI Automation tree and one keyboard shortcut. The only thing that could break this is VLC renaming its own accessibility labels, which has not happened in years.

examples/vlc_auto_player.py (lines 22-64)
Anchor fact

One ComboBox, one Edit child, one Play button. That is the whole tuner.

The trick is that VLC's Open Network Stream dialog exposes its URL field not as a plain text input but as a ComboBox named Network Protocol Down with an editable role:Edit child inside it. A browser-scraping approach would get lost here. Terminator finds the ComboBox by its accessibility name, then drills to the Edit child via a second locator call, types the URL, and clicks the button whose accessibility name is Play Alt+P. Four OS-level lookups total. That is the uncopyable part.

151 lines

The full example script (YouTube livestreams + local file playback + play/pause demo) fits in 151 lines of Python.

examples/vlc_auto_player.py in the Terminator repo

The reason this matters for the question "can I use a computer monitor as a TV" is that every other answer to that question routes you through hardware you have to buy. This answer routes you through code you already have the right to run. One pip install, one python command, and the monitor on your desk is a channel-surfable TV that obeys your AI coding assistant.

Run the command, watch the output

Each step prints what it is doing. The whole thing takes about seven seconds wall-clock on a typical laptop: two seconds for VLC to launch, one and a half for the network dialog to appear, a half second to paste, and five seconds for the stream to buffer.

python vlc_auto_player.py --youtube-link ...

What the sequence actually looks like end to end

For readers who prefer sequence diagrams to code. Five actors, a dozen messages, one monitor showing TV at the end.

From request to live stream

AI agentTerminator SDKOS accessibility treeVLCYour monitordesktop.open_application("vlc.exe")Resolve window handleLaunch processWindow appearspress_key("{Ctrl}n")Open Network Stream dialoglocator("Network Protocol Down").locator("role:Edit")Walk the a11y treeFind Edit child in ComboBoxedit_box.type_text(url)Keystroke injection via UIAlocator("Play Alt+P").click()Stream plays full-screen

Everything this approach gives you that a streaming stick does not

A Fire Stick can play YouTube Live. It cannot be triggered by a cron job, cannot be piped into your terminal, and cannot be scripted by the same AI coding assistant you use for everything else.

No streaming stick, no set-top box, no HDMI adapter

Top results send you to a Roku, a Fire Stick, or a coax-to-HDMI tuner. If a PC is already driving the monitor, you skip every one of those. The signal source is the machine you already own. The tuner is VLC. The remote is an AI agent or a cron job.

Speakers come for free too

The other big complaint in SERP results is audio. Monitors rarely have built-in speakers. Your PC already has audio out: jack, USB DAC, HDMI back-channel, Bluetooth. VLC inherits that. The audio problem dissolves.

Works with any network stream VLC understands

YouTube live, Twitch, m3u8, RTSP security cameras, internet radio. The script's --youtube-link flag just pastes the URL into VLC's Open Network Stream dialog. Swap the URL, get a different channel.

Cross-platform, not just Windows

The same terminator.Desktop() API drives the Windows UIA tree and the macOS AX tree through one selector engine. Change the VLC launch path, the rest of the selectors (Name:Network Protocol Down, role:Edit, Name:Play Alt+P) map to the same accessibility labels on macOS.

Local files work too: --file my_video.mp4

The second half of vlc_auto_player.py (lines 72-130) opens the file dialog, searches for a filename, and presses space to pause/resume. A personal Plex-without-Plex, automated end to end.

Fails loud, not silent

Every step prints what it is doing: 'Opening VLC', 'Opening dialog', 'Pasting YouTube link'. If a selector does not match, you see the failure in the terminal before the next step runs. Easier to debug than a dead-pixel recorder.

Any of these make a decent channel

Anything VLC can open, the script can play. Swap the URL after --youtube-link and you have a new channel.

lofi hip hop radioNASA ISS livestreamlocal news m3u8Twitch gamingYouTube live sportsRTSP security caminternet radiolocal mp4 libraryPlex web UIany network stream

The full shopping list, if you call it that

Compare this list to the one PCWorld gives you. None of this costs extra; all of it is on your desk already.

What you need

  • A monitor with any modern input (HDMI, DisplayPort, USB-C, even DVI). No tuner required, because the PC is the tuner.
  • A PC already driving the monitor. Desktop, laptop, mini PC, Raspberry Pi. Anything that can run VLC and Python.
  • VLC installed (free and open source). The example script uses the default Windows install path; change one line on macOS or Linux.
  • Any audio output on the PC: built-in monitor speakers, USB speakers, a Bluetooth soundbar, or headphones.
  • Terminator SDK: pip install terminator-sdk. The framework that owns the accessibility tree traversal in the example script.
  • A livestream URL. YouTube Live, Twitch, m3u8, RTSP. Paste it after --youtube-link and the script does the rest.

Four steps to a working channel

Total setup time is under three minutes if VLC is already installed. Longer only if you are picking a URL to watch.

  1. 1

    Pip install the SDK

    pip install terminator-sdk

  2. 2

    Grab the example

    examples/vlc_auto_player.py from the Terminator repo, 151 lines.

  3. 3

    Run with a URL

    python vlc_auto_player.py --youtube-link <stream>

  4. 4

    Full-screen VLC

    Press F in VLC once, close your laptop lid.

By the numbers

Four boundary crossings between your AI assistant and the photons on your panel, and about as many lines of Python to wire them up.

0

Lines in vlc_auto_player.py (verified via wc -l)

0

Accessibility-API calls to open, paste, and play

$0

Streaming sticks required

0

Supported OSes: Windows, macOS, Linux

Why a desktop automation framework is the right shape for this

Terminator is not a consumer app. It is a developer framework that gives existing AI coding assistants the ability to control your entire OS, not just write code. Playwright-shaped API for the whole desktop. The reason turning a monitor into a TV falls out for free is that "open VLC, paste URL, click Play" is just another sequence of GUI actions, exactly like the ones you script when building any other desktop workflow. No special plugin. No media server. Just the accessibility tree.

Frequently asked questions

Can you use a computer monitor as a TV?

Yes. A monitor only needs a video signal source and an audio output. If there is a PC already connected to it, that PC can act as the TV by running a media player. Terminator's vlc_auto_player.py shows the full path: open VLC, paste a YouTube livestream URL into the Open Network Stream dialog (Ctrl+N), click Play. Your monitor now shows live content. No streaming stick, no set-top box.

Do I need a streaming stick or set-top box like the other guides say?

Only if there is no computer driving the monitor. The most common case (a monitor already plugged into a desktop, laptop, or mini PC) does not need either. The streaming stick exists to provide CPU and internet, which your PC already supplies. The set-top box exists to decode a cable signal, which you can replace with any internet live TV service viewed through a browser or VLC.

What about audio? Monitors do not have built-in speakers.

Correct for many monitors, but irrelevant here. The PC already has audio output: 3.5 mm jack, USB, HDMI audio return, or Bluetooth. VLC routes to the system default output. Plug speakers, a USB DAC, or a Bluetooth soundbar into the PC, not the monitor. The audio problem that dominates the top SERP results disappears.

Will this work on macOS and Linux too or is it Windows only?

The vlc_auto_player.py example uses the default Windows install path to launch VLC, but Terminator itself is cross-platform. The same terminator.Desktop() API drives the macOS AX tree. Change the open_application() call to "/Applications/VLC.app" on macOS, or just "vlc" on Linux, and the rest of the script works because the accessibility labels (Name:Network Protocol Down, role:Edit, Name:Play Alt+P) are the same on all three platforms.

Why does the script call locator("Name:Network Protocol Down") and then locator("role:Edit") inside it?

VLC's Open Network Stream dialog shows the URL field as a ComboBox (so you can pick from history) with an editable Edit child inside it. Terminator walks the accessibility tree the way the OS sees it: find the ComboBox by its visible label, then find its Edit child, then type into the Edit. This is how the selector engine stays stable across VLC versions even when the visual layout changes, because the accessibility roles do not change.

Does Terminator require network access or send data to a server?

No. Terminator is a local Rust framework exposed as a Python SDK. It reads the OS accessibility tree directly (UIA on Windows, AX on macOS) and injects keystrokes and clicks locally. Nothing about opening VLC or driving the dialog leaves your machine. The only network traffic is whatever VLC itself fetches from the livestream URL you paste in.

What happens if VLC is already running when the script starts?

open_application() at the top of the example is a best-effort launch. If VLC is already running, the function returns the existing window handle instead of starting a second process. The rest of the script (Ctrl+N to open the network stream dialog, drilling into the ComboBox, pressing Play) continues against the existing VLC window with no changes.

Can I wire this up to voice control or a cron job instead of running it manually?

Yes. The entire Python file is just a function. Wrap play_livestream_youtube_video(url) in a cron entry to switch your monitor to the morning news at 7 am, or expose it as a local HTTP endpoint and hit it from a voice assistant. Because the whole flow is an accessibility-driven script, it runs headless at the OS level, not in a browser. It will not break when YouTube changes their DOM.

Make your monitor a TV your AI agent can operate

Terminator is the framework behind examples/vlc_auto_player.py. It gives your AI coding assistant a Playwright-shaped API for every app on your desktop: VLC, browsers, IDEs, accounting software, legacy line-of-business apps. Open source, MIT licensed, Windows UIA and macOS AX.

Star Terminator on GitHub
terminatorDesktop automation SDK
© 2026 terminator. All rights reserved.