aboutsummaryrefslogtreecommitdiffstats
path: root/yeetube.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-08-18 10:04:00 +0300
committerThanos Apollo <[email protected]>2023-08-18 10:04:00 +0300
commit1a525af84ae77050c38ff604bd183650bd842a81 (patch)
tree461393d568c9868c504bb4fb32a896d6587c6da6 /yeetube.el
parentbb8cd69540c81094061fe558061f08b6d9877a9d (diff)
Add yeetube--send-command
Mostly for cycle between values
Diffstat (limited to 'yeetube.el')
-rw-r--r--yeetube.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/yeetube.el b/yeetube.el
index 6639efe..70cc37f 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -240,6 +240,12 @@ It's recommended you keep it as the default value."
(sit-for 0.1) ; wait for the process to finish
(with-current-buffer proc-buffer
(buffer-string))))
+
+(defun yeetube--send-command (property value)
+ "Send command with PROPERTY and VALUE as json-data to mpv socket."
+ (let ((json-data (format "{ \"command\": [\"%s\", \"%s\"]}" property value)))
+ (yeetube-send-command-to-socket yeetube-mpv-socket json-data)))
+
(defun yeetube-toggle-pause-mpv ()
"Toggle play/pause mpv."
(interactive)