diff options
-rw-r--r-- | org-yt.el | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -24,6 +24,10 @@ ;;; Code: + +(require 'org-element) + + (defcustom yt-download-audio-format nil "Select download video as audio FORMAT. If nil yt-download-videos output will be the default format. @@ -34,10 +38,22 @@ Example Usage: :group 'youtube) +;; 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)))) + + ;; TODO: play a video link using a video player from an org-mode read only buffer + ;; TODO: Search Youtube videos play them using a video player |