Thanks for the suggestion I'll try it out.
I got it working for now using a bash script like the following
Code: Select all
#!/bin/sh
dir='/media/usb/'
file=`/bin/ls -1 "$dir" | sort --random-sort | head -1`
path=`readlink --canonicalize "$dir/$file"` # Converts to full path
echo "The randomly-selected file is: $path"
'omxplayer' '-b' $path
dir='/media/usb/'
file=`/bin/ls -1 "$dir" | sort --random-sort | head -1`
path=`readlink --canonicalize "$dir/$file"` # Converts to full path
echo "The randomly-selected file is: $path"
'omxplayer' '-b' $path
dir='/media/usb/fixvid/'
file=`/bin/ls -1 "$dir" | sort --random-sort | head -1`
path=`readlink --canonicalize "$dir/$file"` # Converts to full path
echo "The randomly-selected file is: $path"
'omxplayer' '-b' $path
bash videoplayer.sh
This basically plays 2 videos at random and then pulls the third video from another directory before firing off the same script again.
the problem with this is that it sometimes tries to run the system volume information file but it just throws error and goes onto the next file wich isn't to big of a problem
It's not the best code but for now it works
