diff options
author | Thanos Apollo <[email protected]> | 2023-08-01 11:29:46 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-08-01 11:29:46 +0300 |
commit | 5b16321156f5b0708a3c2841cdd6715d52ce75f3 (patch) | |
tree | f17068e24f22a39a8879e8b4412fe97380974944 /yeetube.el | |
parent | 3abe63d17d42e143b55c3dae350f080262655cbe (diff) |
Add yeetube-play-saved-video
Diffstat (limited to 'yeetube.el')
-rw-r--r-- | yeetube.el | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -153,6 +153,15 @@ It's recommended you keep it as the default value." :raw-link (org-element-context)))) (push (cons name url) yeetube-saved-videos))) +(defun yeetube-play-saved-video () + "Select & Play a saved video." + (interactive) + (let ((video (completing-read "Select video: " yeetube-saved-videos nil t))) + (if (string-match "mpv" yeetube-player) + (shell-command (format "pkill -9 -f mpv")) + (shell-command (format "pkill -9 -f %s" (shell-quote-argument yeetube-player)))) + (call-process-shell-command + (format "%s %s" yeetube-player (cdr (assoc video yeetube-saved-videos))) nil 0))) (defun yeetube-toggle-video-mpv () "Toggle video on/off for mpv player." (interactive) |