play fixed video between random videos
Posted: Fri Sep 15, 2017 2:13 pm
I'm currently using the following code wich continuously play any videos that are on a usb stick in a random order.
What I'd like to do is play a few random video's and play 1 fixed video after wich I start over agian and play random videos before playing another fixed video etc etc.
I can't just add another line as that opens another instance of omxplayer and results in no output at all.
Can someone point me in the right direction?
Code: Select all
#!/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',random.choice(video)])
player.wait()
I can't just add another line as that opens another instance of omxplayer and results in no output at all.
Can someone point me in the right direction?