UMedia
UMedia

User Scripts

UMedia has a built-in Lua (LuaJIT) and JavaScript (MuJS) engine. You can write scripts to automate tasks, draw custom OSD elements, or interact with web APIs.

Installation

Simply place .lua or .js files in your UMedia scripts directory. They will be loaded automatically on startup.

Example: Auto-Pause on Minimize

This Lua script listens for the window minimized state and automatically pauses playback.

-- autopauser.lua
local function on_minimize(name, value)
    if value == true then
        mp.set_property_bool("pause", true)
        mp.osd_message("Playback paused (minimized)")
    end
end

-- Observe the 'window-minimized' property
mp.observe_property("window-minimized", "bool", on_minimize)

Popular Community Scripts

Trakt.tv Scrobbler

Automatically marks TV shows and movies as watched on your Trakt profile when you reach 80% completion.

SubSearch

Press 'S' to hash the current video file, query OpenSubtitles via their API, and download/load the best matching .srt file instantly.

SponsorBlock

When streaming YouTube URLs via yt-dlp, this script automatically skips sponsored segments using the SponsorBlock database.

WebUI

Starts a local HTTP server allowing you to control UMedia from your phone's browser while sitting on the couch.