aboutsummaryrefslogtreecommitdiff
path: root/emacs/.emacs.d/lisp
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2024-05-26 20:55:48 +1000
committerYuchen Pei <id@ypei.org>2024-05-26 20:55:48 +1000
commitbcc1b224be5afe9bfb50c68f87f9c154c703b76f (patch)
tree6d8cf12350649213aec6a3c4061d26ce496f18c9 /emacs/.emacs.d/lisp
parentd599975c477fe9b44a755def9c2b83a3f7de5627 (diff)
[emacs] play video with vlc if possible
Diffstat (limited to 'emacs/.emacs.d/lisp')
-rw-r--r--emacs/.emacs.d/lisp/my/my-emms.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-emms.el b/emacs/.emacs.d/lisp/my/my-emms.el
index 47758f2..f4e9bc0 100644
--- a/emacs/.emacs.d/lisp/my/my-emms.el
+++ b/emacs/.emacs.d/lisp/my/my-emms.el
@@ -159,6 +159,16 @@ either 'audio or 'video
(alist-get type my-extension-types)))
(with-current-buffer to (emms-sort))))
+(defun my-emms-players-preference (track players)
+ "If audio, use first player, otherwise second."
+ (let ((name (emms-track-name track)))
+ (if (and (length> players 1)
+ (string-prefix-p "file://" name)
+ (member (file-name-extension name)
+ '("mkv" "mp4" "ogv" "avi" "webm")))
+ (cadr players)
+ (car players))))
+
(defvar my-emms-playlist-alist nil
"alist controlling playlists, where the cdr of each item is an also an alist,
with possible keys 'source and 'type.