Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions DOCS/man/osc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion player/lua/osc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
--
Expand Down Expand Up @@ -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)
Expand Down
Loading