summaryrefslogtreecommitdiffstats
path: root/player/lua.c
diff options
context:
space:
mode:
Diffstat (limited to 'player/lua.c')
-rw-r--r--player/lua.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/player/lua.c b/player/lua.c
index 576a2395d6..dbe97cc278 100644
--- a/player/lua.c
+++ b/player/lua.c
@@ -421,9 +421,22 @@ static int script_wait_event(lua_State *L)
lua_setfield(L, -2, "type"); // event
break;
}
+ case MPV_EVENT_CLIENT_MESSAGE: {
+ mpv_event_client_message *msg = event->data;
+
+ lua_newtable(L); // event args
+ for (int n = 0; n < msg->num_args; n++) {
+ lua_pushinteger(L, n + 1); // event args N
+ lua_pushstring(L, msg->args[n]); // event args N val
+ lua_settable(L, -3); // event args
+ }
+ lua_setfield(L, -2, "args"); // event
+ break;
+ }
default: ;
}
+ // return event
return 1;
}