Go to advanced search

by Warzon3
Fri Sep 15, 2017 3:55 pm
Forum: Python
Topic: play fixed video between random videos
Replies: 2
Views: 970

Re: play fixed video between random videos

Thanks for the suggestion I'll try it out. I got it working for now using a bash script like the following #!/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: $pat...
by Warzon3
Fri Sep 15, 2017 2:13 pm
Forum: Python
Topic: play fixed video between random videos
Replies: 2
Views: 970

play fixed video between random videos

I'm currently using the following code wich continuously play any videos that are on a usb stick in a random order. #!/usr/bin/python import os import glob from subprocess import Popen import random video = glob.glob(os.path.join('/media/usb/', '*.mp4')) while(1): player = Popen(['omxplayer','-b',ra...

Go to advanced search