summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--org-yt.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/org-yt.el b/org-yt.el
index e605861..602bc9c 100644
--- a/org-yt.el
+++ b/org-yt.el
@@ -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