aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-04-06 20:42:14 +0300
committerThanos Apollo <[email protected]>2024-04-06 20:42:59 +0300
commit56755f394d2130b58f128ebb099584b8e1392b11 (patch)
tree8047c5e7a1e5de53497c352ed0e130e4a2b73c4d
parentf9c28a527a60811c4b60bdd3730ca25c9522739a (diff)
Add yeetube-mpv-currently-playing
Variable to hold info regarding currently playing video/file
-rw-r--r--yeetube-mpv.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/yeetube-mpv.el b/yeetube-mpv.el
index 5070fd5..141e6e9 100644
--- a/yeetube-mpv.el
+++ b/yeetube-mpv.el
@@ -43,6 +43,9 @@
"Video resolution/quality.
Accepted values include: 1080, 720, 480, 360, 240, 144")
+(defvar yeetube-mpv-currently-playing nil
+ "Currently playing information.")
+
(defun yeetube-mpv-change-video-quality ()
"Change video quality."
(interactive)
@@ -81,7 +84,7 @@ Accepted values include: 1080, 720, 480, 360, 240, 144")
"Return shell quoted argument for ytdlp with RESOLUTION."
(shell-quote-argument (format "bestvideo[height<=?%s]+bestaudio/best" resolution)))
-(defun yeetube-mpv-play (input)
+(defun yeetube-mpv-play (input &optional info)
"Start yeetube process to play INPUT using mpv.
This function is not specific to just playing urls. Feel free to use
@@ -97,7 +100,9 @@ to play local files."
(when yeetube-mpv-disable-video " --no-video")))
(message (if yeetube-mpv-enable-torsocks
"yeetube: Starting mpv process (using torsocks)"
- "yeetube: Starting mpv process"))))
+ "yeetube: Starting mpv process"))
+ (setf yeetube-mpv-currently-playing (format "[%s]" info))))
+
(defun yeetube-mpv-toggle-no-video-flag ()
"Toggle no video flag for mpv player."