diff options
Diffstat (limited to 'roles/obs/templates/play-with-intro')
-rwxr-xr-x | roles/obs/templates/play-with-intro | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/roles/obs/templates/play-with-intro b/roles/obs/templates/play-with-intro index 1b1b9a5..7f7865b 100755 --- a/roles/obs/templates/play-with-intro +++ b/roles/obs/templates/play-with-intro @@ -2,23 +2,26 @@ # Play intro if recorded, then play files # {{ ansible_managed }} -# Kill the background music if playing -if screen -list | grep -q background; then - screen -S background -X quit -fi +# play-with-intro $SLUG +YEAR="{{ emacsconf_year }}" +BASE_DIR="{{ emacsconf_caption_dir }}" +CACHE_DIR="{{ emacsconf_caption_dir }}/cache" +FIREFOX_NAME=firefox-esr +SLUG=$1 +PREFIX=$(get-file-prefix $SLUG) + +/usr/local/bin/reset-state # Update the overlay -FILE=$1 -if [[ ! -f $FILE ]]; then - LIST=({{ emacsconf_caption_dir }}/assets/stream/emacsconf-{{ emacsconf_year }}-$FILE*.webm) - FILE="${LIST[0]}" - BY_SLUG=1 -fi -shift -SLUG=$(echo "$FILE" | perl -ne 'if (/emacsconf-[0-9]*-(.*?)--/) { print $1; } else { print; }') overlay $SLUG -# Play the video -if [[ -f {{ emacsconf_caption_dir }}/assets/intros/$SLUG.webm ]]; then - intro $SLUG + +# Play the intro if it exists. If it doesn't exist, switch to the intro slide and stop processing. + +if [[ -f $CACHE_DIR/$PREFIX--intro.webm ]]; then + mpv $CACHE_DIR/$PREFIX--intro.webm +else + firefox --kiosk $BASE_DIR/assets/in-between/$SLUG.png + exit 0 fi -mpv $FILE $* & + +/usr/local/bin/play $SLUG |