I use the Raspberry Pi and the player omxplayer. I would like to RaspbperyPi play movies in a loop from the specified folder. With this I have no problem. Here my code:
Code: Select all
#!/bin/sh
VIDEOPATH="/mnt/storage/videos"
SERVICE="omxplayer"
while true; do
if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
sleep 1;
else
for entry in $VIDEOPATH/*
do
clear
omxplayer $entry --no-keys > /dev/null
done
fi
done
And it works. I have a keyboard connected to it. I want to see when you press eg. "5" I Raspbpery PI launched a video file "5.mp4" (eg key. "8" - file "8.mp4"). Unfortunately omxplayer not support such a switch between files, so I turned off the keyboard listening (parameter: --no-keys).
How, then, to modify this code to loop during playback you can quickly switch to another file?