summaryrefslogtreecommitdiffstats
path: root/roles/obs/templates/mpv-track
diff options
context:
space:
mode:
Diffstat (limited to 'roles/obs/templates/mpv-track')
-rwxr-xr-xroles/obs/templates/mpv-track11
1 files changed, 10 insertions, 1 deletions
diff --git a/roles/obs/templates/mpv-track b/roles/obs/templates/mpv-track
index 77d73bd..db3ea62 100755
--- a/roles/obs/templates/mpv-track
+++ b/roles/obs/templates/mpv-track
@@ -10,7 +10,9 @@ fi
# Update the overlay
FILE=$1
if [[ ! -f $FILE ]]; then
- FILE="/data/emacsconf/assets/stream/emacsconf-2022-$FILE*.webm"
+ LIST=(/data/emacsconf/assets/stream/emacsconf-2022-$FILE*.webm)
+ FILE="${LIST[0]}"
+ BY_SLUG=1
fi
shift
SLUG=$(echo "$FILE" | perl -ne 'if (/^emacsconf-[0-9]*-(.*?)--/) { print $1; } else { print; }')
@@ -28,5 +30,12 @@ else
echo "Could not find /data/emacsconf/assets/overlays/$SLUG-video.png, override ~/video.png manually"
cp /data/emacsconf/assets/overlays/blank-video.png ~/video.png
fi
+if [[ "x$BY_SLUG" == "x1" ]] && [[ -f /data/emacsconf/assets/intros/$SLUG.webm ]]; then
+ INTRO=/data/emacsconf/assets/intros/$SLUG.webm
+ echo "Found intro $INTRO"
+else
+ echo "Could not find /data/emacsconf/assets/intros/$SLUG.webm"
+fi
+
# Play the video
DISPLAY="${DISPLAY:-:{{ item.vnc_id }}}" mpv --input-ipc-server={{ emacsconf_home }}/mpv-socket-{{ emacsconf_id }}-{{ item.id }} --audio-device=pulse/{{ item.id }}-vid --profile={{ emacsconf_id }}-talks $FILE $* &