diff options
author | Thanos Apollo <[email protected]> | 2023-06-30 04:39:18 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-06-30 04:39:18 +0300 |
commit | b4c8ed66622ce64b5bc1317cedb81f289d8072b8 (patch) | |
tree | a719c2ad410e153d86f37545766eaf4e05c19875 | |
parent | 9a7f9b280a5c60dfd7b598f2908f3717aa756004 (diff) | |
parent | 2cc681da96da88d168c7c5d0ab6779eb075bc6f9 (diff) |
Merge branch '#play-videos' into dev
-rw-r--r-- | org-yt.el | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -24,7 +24,17 @@ ;;; Code: -;; TODO: play a video link using a video player from an org-mode read only buffer +(require 'org-element) + +;; TODO: Make a defcustom for video player +(defun yt-play () + "Open the link at point in an `'org-mode buffer with `'mpv." + (interactive) + (let ((url (org-element-property + :raw-link (org-element-context)))) + (when (string-prefix-p "http" url) + (async-shell-command (format "mpv %s" url)) + (message "Opening %s with mpv" url)))) |