summaryrefslogtreecommitdiffstats
path: root/player/lua/ytdl_hook.lua
diff options
context:
space:
mode:
Diffstat (limited to 'player/lua/ytdl_hook.lua')
-rw-r--r--player/lua/ytdl_hook.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/player/lua/ytdl_hook.lua b/player/lua/ytdl_hook.lua
index 8822299671..e489c4edcb 100644
--- a/player/lua/ytdl_hook.lua
+++ b/player/lua/ytdl_hook.lua
@@ -743,3 +743,20 @@ mp.add_hook("on_preloaded", 10, function ()
chapter_list = {}
end
end)
+
+mp.add_forced_key_binding("a", function()
+ print("starting")
+ local ret = mp.command_native_async(
+ {name = "subprocess", args = {"/tmp/test/pid_test"},
+ capture_stdout = true,
+ capture_stderr = true},
+ function(ok, res)
+ print("done " .. utils.format_table(res))
+ end)
+ print("started")
+ -- kill it after some time
+ mp.add_timeout(20, function()
+ print("killing it")
+ mp.abort_async_command(ret)
+ end)
+end) \ No newline at end of file