diff options
-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") |