diff options
author | Thanos Apollo <[email protected]> | 2023-08-18 16:11:52 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-08-18 16:11:52 +0300 |
commit | 12420598f4c07a8fceceb2ae5a0e7792f6be0693 (patch) | |
tree | f0c8e7e23c4d361fcd1faf4bce7841800c12b9db | |
parent | 20b610210f3b15f9ec2f5c5e004c52bfcf244e5d (diff) |
Add yeetube--mpv-play
Used to play url and defining a process session
-rw-r--r-- | yeetube.el | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -216,6 +216,21 @@ Example Usage: (defun yeetube-disable-video-mpv () "Toggle video on/off for mpv player." +(defun yeetube--mpv-play (url) + "Use mpv to play URL." + (let ((mpv (executable-find "mpv")) + (socket (concat (temporary-file-directory) "yeetube-socket")) + (process-name "yeetube")) + (dolist (process (process-list)) + (when (string-match process-name (process-name process)) + (kill-process process))) + (sit-for 0.1) + (unless (get-process process-name) + (start-process-shell-command + "yeetube" nil + (if yeetube-mpv-disable-video + (format "%s --no-video --input-ipc-server=%s %s" mpv socket url) + (format "%s --input-ipc-server= %s %s" mpv socket url)))))) (interactive) (let ((socket (concat " --input-ipc-server=" yeetube-mpv-socket)) (no-video " --no-video") |