From f09959efcfc980ee982a245bc3fcada85b0b31d8 Mon Sep 17 00:00:00 2001 From: Tobias Perschon Date: Sat, 16 Mar 2019 00:53:41 +0100 Subject: [PATCH] implemented wait_time option --- Adafruit_Video_Looper/video_looper.py | 4 ++++ video_looper.ini | 3 +++ 2 files changed, 7 insertions(+) diff --git a/Adafruit_Video_Looper/video_looper.py b/Adafruit_Video_Looper/video_looper.py index 70dbdb0..f6845f7 100644 --- a/Adafruit_Video_Looper/video_looper.py +++ b/Adafruit_Video_Looper/video_looper.py @@ -55,6 +55,8 @@ class VideoLooper(object): self._osd = self._config.getboolean('video_looper', 'osd') self._is_random = self._config.getboolean('video_looper', 'is_random') self._keyboard_control = self._config.getboolean('video_looper', 'keyboard_control') + # Get seconds for waittime bewteen files from config + self._wait_time = self._config.getint('video_looper', 'wait_time') # Parse string of 3 comma separated values like "255, 255, 255" into # list of ints for colors. self._bgcolor = map(int, self._config.get('video_looper', 'bgcolor') \ @@ -218,6 +220,8 @@ class VideoLooper(object): # Load and play a new movie if nothing is playing. if not self._player.is_playing(): movie = playlist.get_next() + if self._wait_time > 0: + time.sleep(self._wait_time) if movie is not None: # Start playing the first available movie. self._print('Playing movie: {0}'.format(movie)) diff --git a/video_looper.ini b/video_looper.ini index fd87a21..5140586 100644 --- a/video_looper.ini +++ b/video_looper.ini @@ -33,6 +33,9 @@ file_reader = usb_drive osd = true #osd = false +# Below you can set a timout time (in seconds) that is waited between each video +wait_time = 0 + # To play random playlist. is_random = false