From 4d83d9051f57eef62c3651732396a669df8975c3 Mon Sep 17 00:00:00 2001 From: mattmcw Date: Sun, 12 May 2024 18:33:03 -0400 Subject: [PATCH] Work on deploying on pi --- omxplayer_playlist.sh | 19 +++++++++++++++++++ playlist.sh | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 omxplayer_playlist.sh diff --git a/omxplayer_playlist.sh b/omxplayer_playlist.sh new file mode 100644 index 0000000..f0de493 --- /dev/null +++ b/omxplayer_playlist.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +VIDEOS="./VIDEOS" +PLAYER="omxplayer -o hdmi --threshold 0" + +fileList="./fileList.txt" +shuffleList=$(mktemp) + +ls -1 "${VIDEOS}/" > "${fileList}" + +while [ 1 -eq 1 ]; do + cat "${fileList}" | shuf > "${shuffleList}" + while read videoIn; do + echo "Playing ${videoIn}..." + ${PLAYER} "${VIDEOS}/${videoIn}" + done < "${shuffleList}" +done diff --git a/playlist.sh b/playlist.sh index 2182c38..47211be 100644 --- a/playlist.sh +++ b/playlist.sh @@ -10,7 +10,7 @@ shuffleList=$(mktemp) ls -1 "${VIDEOS}/" > "${fileList}" rm -rf playlist.txt -count=10 +count=50 for i in $(seq $count); do cat "${fileList}" | shuf > "${shuffleList}" while read videoIn; do @@ -19,4 +19,4 @@ for i in $(seq $count); do done rm -f "${fileList}" -rm -f "${shuffleList}" \ No newline at end of file +rm -f "${shuffleList}"