Home

Awesome

ModernX

[!IMPORTANT] This script is updated most frequently at mpvconfig, stable builds are released here in the releases tab.

A fork of mpvX (based on mpv-osc-modern), that aims to mirror the functionality of MPV's stock OSC while with a more modern-looking interface.

image

[!NOTE] This script is included in my mpvconfig, check that repository for a full mpv configuration

Additional Features

This fork changes the following:

Installation

Locate your MPV folder. It is typically located at \%APPDATA%\mpv\ on Windows and ~/.config/mpv/ on Linux/MacOS. See the Files section in mpv's manual for more info.

[!NOTE] Create these folders if you don't have them already

Place modernx.lua into your mpv scripts/ folder, remove any previous OSC scripts.

Then place the two fonts in the fonts/ folder. Material-Design-Iconic-Font.ttf (click the link to download) and also Material-Design-Iconic-Round.ttf.

mpv.conf

Add the following lines to your mpv.conf file.

[!NOTE] Please note that in .conf files use yes/no in place of true/false

osc=no
border=no #optional - if you don't want to see the OS border

Border differences

This is what disabling and enabling the border looks like:

Border EnabledBorder Disabled
mpv_tkhXHUKNNtmpv_rrIXTdX0Sx

[!NOTE] This option may vary depending on your system.

Configuration

Create an modernx.conf file and place it in the script-opts/ folder (create the folder if you haven't already). A plethora of options can be changed, so please refer to the table of configurable user_opts parameters below for detailed explanations of settings.

Example

Here is an example of a configuration file, which would be placed in script-opts/modernx.conf:

compactmode=no
showinfo=yes
titlefontsize=20
seekbarhandlesize=0

Configurable Options

OptionDescription
languageThe language of the osc, mostly messages that are shown in the top left of the screen <br> mpv_rWXEhJCgFO
welcomescreenWhether to show the mpv 'Drop files or URLs to play here.' screen <br> mpv_DuuCGjbj16
windowcontrolsWhether to show OSC window controls, 'auto' will only show them in fullscreen or when borderless, 'yes' always shows them and 'no' never shows them
keybindingsIf to register keybindings i.e. chapter scrubbing, pinning window
showwindowedWhether to show the OSC when windowed
showfullscreenWhether to show the OSC when in fullscreen
noxmasDisable showing the santa hat in December
keybindingsWhether the script should register keybindings for things like chapter scrubbing
vidscaleWhether the OSC scales with the window's size
scalewindowedThe scaling of the OSC when windowed
scalefullscreenThe scaling of the OSC when in fullscreen
scaleforcedwindowThe scaling when rendered on a forced window (like an audio file)
hidetimeoutDuration in ms until the OSC hides when there is no mouse movement
fadedurationDuration in ms of the fade effect the OSC exihibts
minmousemoveThe minimum amount of pixels the mouse has to move for the OSC to show
scrollingSpeedThe speed of scrolling text in menus
showonpauseWhether to disable the hide timeout on pause (when enabled, pausing will show the OSC instantly)
donttimeoutonpauseWhether to disable the hide timeout on pause
bottomhoverIf the osc should only display when hovering over UI elements at the bottom of the window (includes the window control buttons at the top if visible) <br> On: <br> mpv_UuIaS6QEQG <br> Off: <br> mpv_PDZfBO3tVn
raisesubswithoscWhether to raise any subtitles being shown, if the OSC is being shown <br> mpv_gpAsmbHnNs
thumbnailborderThe width of outline of the thumbnail border
persistentprogressWhether to always show a small progress line at the bottom of the screen
persistentprogressheightThe height of the persistentprogress bar
persistentbufferWhether, on web videos to show the buffer on the persistent progress line
persistentprogresstoggleWhether to enable toggling the persistentprogress bar
showtitleWhether to show the title in the OSC
showdescriptionWhether to show video description on web videos, clicking it will show an on-screen box of the full description <br> 2024-04-28_07-34-51_077_mpv
showwindowtitleWhether to show to window title, when the window is borderless/fullscreened (this will match whatever is set in your mpv.conf file) <br> mpv_4hhWPnDWZS
showfilesizeWhether to show the current file's size in the description
titleBarStripWhether to make the title bar a singular bar, instead of a black fade at the top of the screen
titleWhat title is shown in the OSC, see the mpv manual for more properties - turn off dynamictitle for this option to be respected
dynamictitleChanged what title information is shown depending on if the filename and media-title properties differ, seen most in audio files and playing urls
updatetitleyoutubestatsWhether to update the window/OSC title bar with YouTube video stats (views, likes, dislikes)
fontThe font of the OSC, by default matches the font set in mpv.conf
titlefontsizeThe size of the title text
chapterformatThe format of the chapter text when hovering over the seekbar. Use 'no' to disable
dateformathow dates should be formatted, when read from metadata (uses standard lua date formatting) <br> 2024-04-28_07-22-13_315_mpv
osc_colorThe colour of the OSC and title bar
OSCfadealphaAlpha of the background box for the OSC
boxalphaAlpha of the fade box effect, 0 (opaque) to 255 (fully transparent)
descriptionBoxAlphaAlpha of the description background box
seekbarfg_colorColour of current seekbar progress and the handle
seekbarbg_colorColour of the remaining seekbar
seekbarkeyframesWhether to use keyframes when dragging the seekbar
automatickeyframemodeWhether to set seekbarkeyframes based on video length to prevent laggy scrubbing on long videos
automatickeyframelimitVideos of above this length (in seconds) will have seekbarkeyframes on
seekbarhandlesizeHow big the seek bar handle appears, from 0 to 1
seekrangeWhether to show the buffer range on the seekbar
seekrangealphaThe transparency of seekranges
iconstyleWhether the icons are normal or round varients - thanks to https://github.com/cyl0/ModernX/pull/55
hovereffectWhether buttons emit a glowing effect when hovered over
timetotalWhether to display the total time instead of remaining time
timemsWhether to display time in milliseconds
timefontsizeThe font size of the time
jumpamountHow many seconds the jump buttons jump by
jumpiconnumberWhether to show 5, 10 or 30 in the jump icons if the jumpamount are any of those values
jumpmodeWhat kind of seeking mode is used for the jump buttons
volumecontrolWhether to show the mute button and volume slider
volumecontroltypeWhether to use linear or logarithmic volume scale
showjumpWhether to show the jump forward/backward buttons
showskipWhether to show the chapter buttons
compactmodeRemove the 'jump' buttons and embed that functionality in the 'chapter' buttons, see compact mode for more information
showloopWhether to show the loop button
loopinpauseWhether to activate looping by right clicking pause
showontopWhether to show the pin window on top button
showinfoWhether to show the info button
downloadbuttonWhether to show download button for web videos
downloadpathThe download path for videos
showyoutubecommentsEXPERIMENTAL - not ready, show YouTube comments below the clickable description
commentsdownloadpathThe download path for the comment JSON file
ytdlpQualityWhat quality of video the download button uses (a max quality mp4 by is downloaded by default)

The default options are shown below:

-- Parameters
-- default user option values
-- Change them using osc.conf
local user_opts = {
    -- general settings --
    language = 'en',                -- en:English, chs:Chinese, pl:Polish, jp:Japanese
    welcomescreen = true,           -- show the mpv 'play files' screen upon open
    windowcontrols = 'auto',        -- whether to show OSC window controls, 'auto', 'yes' or 'no'
    showwindowed = true,            -- show OSC when windowed?
    showfullscreen = true,          -- show OSC when fullscreen?
    noxmas = false,                 -- disable santa hat in December
    keybindings = true,             -- register keybindings i.e. chapter scrubbing, pinning window
    
    -- scaling settings --
    vidscale = false,               -- whether to scale the controller with the video
    scalewindowed = 1.0,            -- scaling of the controller when windowed
    scalefullscreen = 1.0,          -- scaling of the controller when fullscreen
    scaleforcedwindow = 1.0,        -- scaling when rendered on a forced window

    -- interface settings --
    hidetimeout = 2000,             -- duration in ms until OSC hides if no mouse movement
    fadeduration = 150,             -- duration of fade out in ms, 0 = no fade
    minmousemove = 0,               -- amount of pixels the mouse has to move for OSC to show
    scrollingSpeed = 40,            -- the speed of scrolling text in menus
    showonpause = true,             -- whether to show to osc when paused
    donttimeoutonpause = false,     -- whether to disable the hide timeout on pause
    bottomhover = true,             -- if the osc should only display when hovering at the bottom
    raisesubswithosc = true,        -- whether to raise subtitles above the osc when it's shown
    thumbnailborder = 2,            -- the width of the thumbnail border
    persistentprogress = false,     -- always show a small progress line at the bottom of the screen
    persistentprogressheight = 17,  -- the height of the persistentprogress bar
    persistentbuffer = false,       -- on web videos, show the buffer on the persistent progress line
    persistentprogresstoggle = true,-- enable toggling the persistentprogress bar

    -- title and chapter settings --
    showtitle = true,               -- show title in OSC
    showdescription = true,         -- show video description on web videos
    showwindowtitle = true,         -- show window title in borderless/fullscreen mode
    showfilesize = true,            -- show the current file's size in the description
    titleBarStrip = true,           -- whether to make the title bar a singular bar instead of a black fade
    title = '${media-title}',       -- title shown on OSC - turn off dynamictitle for this option to apply
    dynamictitle = true,            -- change the title depending on if {media-title} and {filename} 
                                    -- differ (like with playing urls, audio or some media)
    updatetitleyoutubestats = true, -- update the window/OSC title bar with YouTube video stats (views, likes, dislikes)
    font = 'mpv-osd-symbols',       -- mpv-osd-symbols = default osc font (or the one set in mpv.conf)
                                    -- to be shown as OSC title
    titlefontsize = 28,             -- the font size of the title text
    chapterformat = 'Chapter: %s',  -- chapter print format for seekbar-hover. "no" to disable
    dateformat = "%Y-%m-%d",        -- how dates should be formatted, when read from metadata (uses standard lua date formatting)
    osc_color = '000000',           -- accent of the OSC and the title bar
    OSCfadealpha = 150,             -- alpha of the background box for the OSC
    boxalpha = 75,                  -- alpha of the window title bar
    descriptionBoxAlpha = 100,      -- alpha of the description background box

    -- seekbar settings --
    seekbarfg_color = 'E39C42',     -- color of the seekbar progress and handle
    seekbarbg_color = 'FFFFFF',     -- color of the remaining seekbar
    seekbarkeyframes = false,       -- use keyframes when dragging the seekbar
    automatickeyframemode = true,   -- set seekbarkeyframes based on video length to prevent laggy scrubbing on long videos 
    automatickeyframelimit = 600,  -- videos of above this length (in seconds) will have seekbarkeyframes on
    seekbarhandlesize = 0.8,        -- size ratio of the slider handle, range 0 ~ 1
    seekrange = true,               -- show seekrange overlay
    seekrangealpha = 150,           -- transparency of seekranges
    iconstyle = 'round',            -- icon style, 'solid' or 'round'
    hovereffect = true,             -- whether buttons have a glowing effect when hovered over

    -- button settings --
    timetotal = true,               -- display total time instead of remaining time by default
    timems = false,                 -- show time as milliseconds by default
    timefontsize = 18,              -- the font size of the time
    jumpamount = 5,                 -- change the jump amount (in seconds by default)
    jumpiconnumber = true,          -- show different icon when jumpamount is 5, 10, or 30
    jumpmode = 'relative',          -- seek mode for jump buttons - https://mpv.io/manual/stable/#command-interface-seek-%3Ctarget%3E-[%3Cflags%3E]
    volumecontrol = true,           -- whether to show mute button and volume slider
    volumecontroltype = 'linear',   -- use 'linear' or 'log' (logarithmic) volume scale
    showjump = true,                -- show "jump forward/backward 5 seconds" buttons 
    showskip = true,                -- show the skip back and forward (chapter) buttons
    compactmode = true,             -- replace the jump buttons with the chapter buttons, clicking the
                                    -- buttons will act as jumping, and shift clicking will act as
                                    -- skipping a chapter
    showloop = true,                -- show the loop button
    loopinpause = true,             -- activate looping by right clicking pause
    showontop = true,               -- show window on top button
    showinfo = false,               -- show the info button
    downloadbutton = true,          -- show download button for web videos
    downloadpath = "~~desktop/mpv/downloads", -- the download path for videos
    showyoutubecomments = false,    -- EXPERIMENTAL - not ready
    commentsdownloadpath = "~~desktop/mpv/downloads/comments", -- the download path for the comment JSON file
    ytdlpQuality = '-f bestvideo[vcodec^=avc][ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' -- what quality of video the download button uses (max quality mp4 by default)
}

Compact Mode

Compact mode is a setting you can enable in the configuration, it removes the skip buttons, and places that functionality within the chapter buttons, allowing for more space in the interface. Clicking the buttons will act as jumping, and shift clicking will act as skipping a chapter

Compact Mode EnabledCompact Mode Disabled
mpv_EIgoJwS7WXmpv_au7Au4oZso

[!IMPORTANT] This changes the actions of the chapter back/forward buttons in the following way:

Thumbnails

To enable thumbnails on the seekbar, install thumbfast. No other step necessary.

mpv_UzSC2z3vIt

Buttons

Like the built-in script, some buttons may accept multiple mouse actions, here is a list:

[!NOTE] Middle clicking performs the same function as Shift+left mouse button, allowing for one handed use

Title

Description (only on certain videos)

Seekbar

Playback time

Duration

Playlist back/forward buttons

Skip back/forward buttons

Jump back/forward buttons

Audio/subtitle track buttons

Pin button

Volume

Other