mirror of
https://github.com/mpv-player/mpv
synced 2025-03-22 03:08:33 +00:00
osc: support speed-independent time-remaiing display
The new OSC config option "remaining_playtime" controls whether the time-remaining display considers speed (yes - default) or ignores it.
This commit is contained in:
parent
b51036cdc0
commit
dfbdf75165
@ -310,6 +310,13 @@ Configurable Options
|
|||||||
|
|
||||||
Show total time instead of time remaining
|
Show total time instead of time remaining
|
||||||
|
|
||||||
|
``remaining_playtime``
|
||||||
|
Default: yes
|
||||||
|
|
||||||
|
Whether the time-remaining display takes speed into account.
|
||||||
|
``yes`` - how much playback time remains at the current speed.
|
||||||
|
``no`` - how much video-time remains.
|
||||||
|
|
||||||
``timems``
|
``timems``
|
||||||
Default: no
|
Default: no
|
||||||
|
|
||||||
|
@ -42,6 +42,8 @@ local user_opts = {
|
|||||||
-- to be shown as OSC title
|
-- to be shown as OSC title
|
||||||
tooltipborder = 1, -- border of tooltip in bottom/topbar
|
tooltipborder = 1, -- border of tooltip in bottom/topbar
|
||||||
timetotal = false, -- display total time instead of remaining time?
|
timetotal = false, -- display total time instead of remaining time?
|
||||||
|
remaining_playtime = true, -- display the remaining time in playtime or video-time mode
|
||||||
|
-- playtime takes speed into account, whereas video-time doesn't
|
||||||
timems = false, -- display timecodes with milliseconds?
|
timems = false, -- display timecodes with milliseconds?
|
||||||
tcspace = 100, -- timecode spacing (compensate font size estimation)
|
tcspace = 100, -- timecode spacing (compensate font size estimation)
|
||||||
visibility = "auto", -- only used at init to set visibility_mode(...)
|
visibility = "auto", -- only used at init to set visibility_mode(...)
|
||||||
@ -2105,10 +2107,12 @@ function osc_init()
|
|||||||
ne.content = function ()
|
ne.content = function ()
|
||||||
if (state.rightTC_trem) then
|
if (state.rightTC_trem) then
|
||||||
local minus = user_opts.unicodeminus and UNICODE_MINUS or "-"
|
local minus = user_opts.unicodeminus and UNICODE_MINUS or "-"
|
||||||
|
local property = user_opts.remaining_playtime and "playtime-remaining"
|
||||||
|
or "time-remaining"
|
||||||
if state.tc_ms then
|
if state.tc_ms then
|
||||||
return (minus..mp.get_property_osd("playtime-remaining/full"))
|
return (minus..mp.get_property_osd(property .. "/full"))
|
||||||
else
|
else
|
||||||
return (minus..mp.get_property_osd("playtime-remaining"))
|
return (minus..mp.get_property_osd(property))
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if state.tc_ms then
|
if state.tc_ms then
|
||||||
|
Loading…
Reference in New Issue
Block a user