diff options
author | Sacha Chua <sacha@sachachua.com> | 2022-11-26 10:31:17 -0500 |
---|---|---|
committer | Sacha Chua <sacha@sachachua.com> | 2022-11-26 10:31:17 -0500 |
commit | 2a9d46c99b30fa097651a2a36ac268b3ecf1221b (patch) | |
tree | 449b26affe68752f35a7f863a71f85c5b758b584 | |
parent | 90a2795aae0c92217886f9db1dce5f44a1ec3813 (diff) | |
download | emacsconf-el-2a9d46c99b30fa097651a2a36ac268b3ecf1221b.tar.xz emacsconf-el-2a9d46c99b30fa097651a2a36ac268b3ecf1221b.zip |
handle live talks that have intros
-rw-r--r-- | emacsconf-stream.el | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/emacsconf-stream.el b/emacsconf-stream.el index 09e01fb..76c7809 100644 --- a/emacsconf-stream.el +++ b/emacsconf-stream.el @@ -179,31 +179,38 @@ while OTHER-FILENAME will be displayed at other times." (emacsconf-stream-set-talk-info talk)))) (defun emacsconf-stream-play-intro-maybe (talk) + (interactive (list (emacsconf-complete-talk-info))) (when (file-exists-p (expand-file-name (concat (plist-get talk :slug) ".webm") (expand-file-name "intros" emacsconf-stream-asset-dir))) - (emacsconf-stream-play-video - (append - talk - :stream-files - (expand-file-name (concat (plist-get talk :slug) ".webm") - (expand-file-name "intros" emacsconf-stream-asset-dir)))))) + (let ((info (tramp-dissect-file-name (emacsconf-stream-track-login talk)))) + (apply + #'call-process + (append + (list + "ssh" nil nil t + (concat (tramp-file-name-user info) + "@" (tramp-file-name-host info)) + "-p" (tramp-file-name-port info) + "nohup" "~/bin/track-mpv" (concat "~/assets/intros/" (plist-get talk :slug) ".webm")) + (list ">" "/dev/null" "2>&1" "&")))))) (defun emacsconf-stream-play-talk-on-change (talk) "Play the talk." - (when (string= org-state "PLAYING") + (interactive (list (emacsconf-complete-talk-info))) + (when (or (not (boundp 'org-state)) (string= org-state "PLAYING")) (if (plist-get talk :video-file) (save-window-excursion (emacsconf-stream-play-video talk)) (let ((default-directory (emacsconf-stream-track-login talk)) (async-shell-command-buffer 'new-buffer)) (save-window-excursion - (emacsconf-stream-play-video talk) (shell-command (concat "nohup firefox -new-window " (shell-quote-argument (plist-get talk :bbb-room)) - " > /dev/null 2>&1 & "))))))) + " > /dev/null 2>&1 & ")) + (emacsconf-stream-play-intro-maybe talk)))))) (defun emacsconf-stream-get-filename (talk) "Return the local filename for the video file for TALK. |