@@ -128,6 +128,7 @@ window_border_size=1
|
|||||||
window_border_opacity=0.8
|
window_border_opacity=0.8
|
||||||
|
|
||||||
# If there's no playlist and file ends, load next file in the directory
|
# If there's no playlist and file ends, load next file in the directory
|
||||||
|
# Requires `keep-open=yes` in `mpv.conf`.
|
||||||
next_file_on_end=no
|
next_file_on_end=no
|
||||||
# Enable playlist/directory navigation shuffling
|
# Enable playlist/directory navigation shuffling
|
||||||
# This is required to implement shuffling that works as expected, including
|
# This is required to implement shuffling that works as expected, including
|
||||||
|
@@ -242,6 +242,8 @@ options.foreground = serialize_rgba(options.foreground).color
|
|||||||
options.foreground_text = serialize_rgba(options.foreground_text).color
|
options.foreground_text = serialize_rgba(options.foreground_text).color
|
||||||
options.background = serialize_rgba(options.background).color
|
options.background = serialize_rgba(options.background).color
|
||||||
options.background_text = serialize_rgba(options.background_text).color
|
options.background_text = serialize_rgba(options.background_text).color
|
||||||
|
-- Ensure required environment configuration
|
||||||
|
if options.next_file_on_end then mp.command('set keep-open-pause no') end
|
||||||
|
|
||||||
--[[ CONFIG ]]
|
--[[ CONFIG ]]
|
||||||
|
|
||||||
@@ -4162,18 +4164,24 @@ mp.register_event('file-loaded', function()
|
|||||||
set_state('path', normalize_path(mp.get_property_native('path')))
|
set_state('path', normalize_path(mp.get_property_native('path')))
|
||||||
update_title(mp.get_property_native('title'))
|
update_title(mp.get_property_native('title'))
|
||||||
end)
|
end)
|
||||||
mp.register_event('end-file', function() set_state('title', nil) end)
|
mp.register_event('end-file', function(event)
|
||||||
|
set_state('title', nil)
|
||||||
|
if event.reason == 'eof' then
|
||||||
|
file_end_timer:kill()
|
||||||
|
handle_file_end()
|
||||||
|
end
|
||||||
|
end)
|
||||||
mp.observe_property('title', 'string', function(_, title)
|
mp.observe_property('title', 'string', function(_, title)
|
||||||
-- Don't change title if there is currently none
|
-- Don't change title if there is currently none
|
||||||
if state.title then update_title(title) end
|
if state.title then update_title(title) end
|
||||||
end)
|
end)
|
||||||
mp.observe_property('playback-time', 'number', create_state_setter('time', function()
|
mp.observe_property('playback-time', 'number', create_state_setter('time', function()
|
||||||
-- Create a file-end event that triggers right before file is closed.
|
-- Create a file-end event that triggers right before file ends.
|
||||||
file_end_timer:kill()
|
file_end_timer:kill()
|
||||||
if state.duration and state.time then
|
if state.duration and state.time then
|
||||||
local remaining = state.duration - state.time
|
local remaining = state.duration - state.time
|
||||||
if remaining < 5 then
|
if remaining < 5 then
|
||||||
local timeout = remaining - 0.3
|
local timeout = remaining - 0.02
|
||||||
if timeout > 0 then
|
if timeout > 0 then
|
||||||
file_end_timer.timeout = timeout
|
file_end_timer.timeout = timeout
|
||||||
file_end_timer:resume()
|
file_end_timer:resume()
|
||||||
|
Reference in New Issue
Block a user