diff --git a/DOCS/man/osc.rst b/DOCS/man/osc.rst index 63bb543a00f78..d6f477d8d0912 100644 --- a/DOCS/man/osc.rst +++ b/DOCS/man/osc.rst @@ -733,6 +733,10 @@ The OSC supports displaying preview thumbnails when hovering over the seekbar if a compatible thumbnailer script is installed. It communicates with a thumbnailer script via the following ``user-data`` properties: +``user-data/osc/thumbnailer-enabled`` + Boolean property set by the thumbnailer to signal that it is capable of + providing thumbnail for the currently playing file. + ``user-data/osc/draw-preview`` Set by the OSC to request a thumbnail within the currently playing file. The requested thumbnail timestamp in seconds is set in diff --git a/player/lua/osc.lua b/player/lua/osc.lua index 8d4f8ffa1099c..628d3d1ee06f8 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -365,6 +365,10 @@ local santa_hat_lines = { -- luacheck: pop +local thumbnailer_enabled = false +mp.observe_property("user-data/osc/thumbnailer-enabled", "bool", + function(_, val) thumbnailer_enabled = val or false end) + -- -- Helper functions -- @@ -1198,7 +1202,7 @@ local function render_elements(master_ass) -- thumbnail local vop = mp.get_property_native("video-out-params") local draw_thumbnail = state.osd_dimensions.w > 0 and vop - if draw_thumbnail then + if draw_thumbnail and thumbnailer_enabled then local r_w, r_h = get_virt_scale_factor() local thumb_max = math.min(user_opts.max_thumb_size, math.min(state.osd_dimensions.w, state.osd_dimensions.h) * 0.25)