On a Raspberry, I made a custom slideshow with movies and pictures. I am expanding the script so I can also choose a clip to play if necessary. I made a menu with 3 options:
- Slideshow
- Clips
- Shutdown
The Slideshow is an infinite loop:
case $opt in
"Slideshow")
PLAY="1"
while true; do
if [ "$PLAY" = "1" ];
then
PLAY=2
bash ./videoplayer.sh
else
PLAY=1
bash ./pictureplayer.sh
fi
done
;;
The example of videoplayer.sh:
VIDEOPATH="/home/pi/ftp/video"
for entry in $VIDEOPATH/*
do
clear
omxplayer "$entry" > /dev/null
done
The example of pictureplayer.sh:
PICTUREPATH="/home/pi/ftp/picture"
fbi -a --noverbose -t 30 -u -1 $PICTUREPATH/*.png
At any given moment I would like to stop the while loop and show the menu again. Even if it is in the middle of a clip playing. I only found options that can read an input after or before every play of a clip/picture.