Unified · Split
| @@ -156,6 +156,10 @@ extra commands can also be used as part of the protocol: · 155 unmodified lines | ||
| 156 | 156 | Undo one ``suspend`` call. ``suspend`` increments an internal counter, and |
| 157 | 157 | ``resume`` decrements it. When 0 is reached, the player is actually resumed. |
| 158 | 158 | |
| 159 | +``get_version`` | |
| 160 | + Returns the client API version the C API of the remote mpv instance | |
| 161 | + provides. (Also see ``DOCS/client-api-changes.rst``.) | |
| 162 | + | |
| 159 | 163 | UTF-8 |
| 160 | 164 | ----- |
| 161 | 165 | |
| @@ -287,6 +287,10 @@ static char *json_execute_command(struct client_arg *arg, void *ta_parent, · 286 unmodified lines | ||
| 287 | 287 | int64_t time_us = mpv_get_time_us(arg->client); |
| 288 | 288 | mpv_node_map_add_int64(ta_parent, &reply_node, "data", time_us); |
| 289 | 289 | rc = MPV_ERROR_SUCCESS; |
| 290 | + } else if (!strcmp("get_version", cmd)) { | |
| 291 | + int64_t ver = mpv_client_api_version(); | |
| 292 | + mpv_node_map_add_int64(ta_parent, &reply_node, "data", ver); | |
| 293 | + rc = MPV_ERROR_SUCCESS; | |
| 290 | 294 | } else if (!strcmp("get_property", cmd)) { |
| 291 | 295 | mpv_node result_node; |
| 292 | 296 | |