summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-07-06 12:16:31 +0300
committerThanos Apollo <[email protected]>2023-07-06 12:16:31 +0300
commit971a18d256f515742752b21dfbddfad74f7c90d1 (patch)
treeb8dfdf238831d243fab857f38a6903029b042f6c
parent6cabd95fa89e93fc5cd6bea6e958784cb8c17a62 (diff)
Add yeetube-toggle-pause-mpv
Play/pause mpv
-rw-r--r--yeetube.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/yeetube.el b/yeetube.el
index 83d411b..fbdfc38 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -132,6 +132,13 @@ It's recommended you keep it as the default value."
(if (equal yeetube-player "mpv --input-ipc-server=/tmp/mpvsocket")
"mpv --no-video --input-ipc-server=/tmp/mpvsocket"
"mpv --input-ipc-server=/tmp/mpvsocket"))))
+
+(defun yeetube-toggle-pause-mpv ()
+ "Play/Pause mpv."
+ (interactive)
+ (when yeetube-player
+ (shell-command "echo '{ \"command\": [\"cycle\", \"pause\"] }' | socat - /tmp/mpvsocket")))
+
;; we should use something like
;; (decode-coding-region (point-min) (point-max) 'utf-8
;; (get-buffer-create "decoded"))