From 6abb7e385f8f2f22511da13fe506a2cbdf7f5584 Mon Sep 17 00:00:00 2001 From: Retusthese <84878539+Retusthese@users.noreply.github.com> Date: Wed, 26 May 2021 21:15:16 -0400 Subject: osc: re-initialize when chapter list changes When the OSC initializes, it checks whether the current video has chapters, and if it does not, it disables its chapter functionality (chapter buttons are grayed out and unusable, chapter indicators don't show on the seek bar). If another script changed the chapter list after the video has loaded, those changes would be ignored by the OSC until some other event causes it to re-initialize, because it did not observe the chapter list property. This is fixed by adding observation of chapter-list alongside the other properties that trigger re-initialization. --- player/lua/osc.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/player/lua/osc.lua b/player/lua/osc.lua index bea95e1323..95c61025fe 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -2598,6 +2598,7 @@ mp.register_event("shutdown", shutdown) mp.register_event("start-file", request_init) mp.observe_property("track-list", nil, request_init) mp.observe_property("playlist", nil, request_init) +mp.observe_property("chapter-list", nil, request_init) mp.register_script_message("osc-message", show_message) mp.register_script_message("osc-chapterlist", function(dur) -- cgit v1.2.3