bash_tv/omxplayer_playlist.sh

20 lines
374 B
Bash

#!/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