Ben-Kerman/mpv-sub-scripts

toggle hide_while_playing possible? for sub-pause.lua

Opened this issue · 0 comments

I used sub-voracious.lua a while back and loved the listening mode which could be toggled. It only does srt and not vtt though.

sub-pause also has "listening mode" if you will and you just need to change the sub-pause.conf

# if autopausing is enabled, hide subtitles while not paused
# Listening mode
hide_while_playing=yes

and everything works great.

Anyway to make this a keybind to toggle.

I tried (obviously I'm not a programmer)

local hide_while_playing = cfg.hide_while_playing

function listening_mode()
	if cfg.hide_while_playing == true then
		mp.set_property_bool("hide_while_playing", false)
	else 
		mp.set_property_bool("hide_while_playing", true)
	end
end

mp.add_key_binding(nil, "listening_mode", function() listening_mode() end)