Skip to content

Commit d6d161d

Browse files
committed
v1.0.15
stop playback after each file (#202) Co-authored-by: Tobias Perschon <[email protected]>
1 parent 55cb6d8 commit d6d161d

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

Adafruit_Video_Looper/video_looper.py

+7
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def __init__(self, config_path):
5757
# Load other configuration values.
5858
self._osd = self._config.getboolean('video_looper', 'osd')
5959
self._is_random = self._config.getboolean('video_looper', 'is_random')
60+
self._one_shot_playback = self._config.getboolean('video_looper', 'one_shot_playback')
6061
self._resume_playlist = self._config.getboolean('video_looper', 'resume_playlist')
6162
self._keyboard_control = self._config.getboolean('control', 'keyboard_control')
6263
self._copyloader = self._config.getboolean('copymode', 'copyloader')
@@ -435,6 +436,7 @@ def _handle_keyboard_shortcuts(self):
435436
self._print("k was pressed. skipping...")
436437
self._playlist.seek(1)
437438
self._player.stop(3)
439+
self._playbackStopped = False
438440
if event.key == pygame.K_s:
439441
if self._playbackStopped:
440442
self._print("s was pressed. starting...")
@@ -454,6 +456,7 @@ def _handle_keyboard_shortcuts(self):
454456
self._print("b was pressed. jumping back...")
455457
self._playlist.seek(-1)
456458
self._player.stop(3)
459+
self._playbackStopped = False
457460

458461
def _handle_gpio_control(self, pin):
459462
if self._pinMap == None:
@@ -462,6 +465,7 @@ def _handle_gpio_control(self, pin):
462465
self._print("pin {} triggered: {}".format(pin, action))
463466
self._playlist.set_next(action)
464467
self._player.stop(3)
468+
self._playbackStopped = False
465469

466470
def _gpio_setup(self):
467471
if self._pinMap == None:
@@ -511,6 +515,9 @@ def run(self):
511515
if self._playlist.length()==1:
512516
infotext = '(endless loop)'
513517

518+
if self._one_shot_playback:
519+
self._playbackStopped = True
520+
514521
# Start playing the first available movie.
515522
self._print('Playing movie: {0} {1}'.format(movie, infotext))
516523
# todo: maybe clear screen to black so that background (image/color) is not visible for videos with a resolution that is < screen resolution

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ For a detailed tutorial visit: <https://learn.adafruit.com/raspberry-pi-video-lo
1414
There are also pre-compiled images available from <https://videolooper.de> (but they might not always contain the latest version of pi_video_looper)
1515

1616
## Changelog
17+
#### new in v1.0.15
18+
- one shot playback: option to enable stopping playback after each file (usefull in combination with gpio triggers)
19+
1720
#### new in v1.0.14
1821
- control the video looper via RPI GPIO pins (see section "control" below)
1922

assets/video_looper.ini

+4
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ is_random = false
8888
resume_playlist = false
8989
#resume_playlist = true
9090

91+
# stop playback after each file
92+
one_shot_playback = false
93+
#one_shot_playback = true
94+
9195
# Set the background to a custom image
9296
# This image is displayed between movies or images
9397
# an image will be scaled to the display resolution and centered. Use i.e.

0 commit comments

Comments
 (0)