Skip to content

Commit

Permalink
v1.0.18 (#223)
Browse files Browse the repository at this point in the history
- fixed one-shot playback with only one video file
- added option to not start video playback on looper startup (boot)
  • Loading branch information
tofuSCHNITZEL authored May 20, 2024
1 parent 141ad15 commit cf0fd4d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
13 changes: 10 additions & 3 deletions Adafruit_Video_Looper/video_looper.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def __init__(self, config_path):
self._osd = self._config.getboolean('video_looper', 'osd')
self._is_random = self._config.getboolean('video_looper', 'is_random')
self._one_shot_playback = self._config.getboolean('video_looper', 'one_shot_playback')
self._play_on_startup = self._config.getboolean('video_looper', 'play_on_startup')
self._resume_playlist = self._config.getboolean('video_looper', 'resume_playlist')
self._keyboard_control = self._config.getboolean('control', 'keyboard_control')
self._copyloader = self._config.getboolean('copymode', 'copyloader')
Expand Down Expand Up @@ -105,7 +106,8 @@ def __init__(self, config_path):
self._medium_font = pygame.font.Font(None, 96)
self._big_font = pygame.font.Font(None, 250)
self._running = True
self._playbackStopped = False
# set the inital playback state according to the startup setting.
self._playbackStopped = not self._play_on_startup
#used for not waiting the first time
self._firstStart = True

Expand Down Expand Up @@ -527,13 +529,18 @@ def run(self):
if self._playlist.length()==1:
infotext = '(endless loop)'

#player loop setting:
player_loop = -1 if self._playlist.length()==1 else None

#special one-shot playback condition
if self._one_shot_playback:
self._playbackStopped = True

player_loop = None

# Start playing the first available movie.
self._print('Playing movie: {0} {1}'.format(movie, infotext))
# todo: maybe clear screen to black so that background (image/color) is not visible for videos with a resolution that is < screen resolution
self._player.play(movie, loop=-1 if self._playlist.length()==1 else None, vol = self._sound_vol)
self._player.play(movie, loop=player_loop, vol = self._sound_vol)

# Check for changes in the file search path (like USB drives added)
# and rebuild the playlist.
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ For a detailed tutorial visit: <https://learn.adafruit.com/raspberry-pi-video-lo
There are also pre-compiled images available from <https://videolooper.de> (but they might not always contain the latest version of pi_video_looper)

## Changelog
#### v1.0.18
- fixed one-shot playback with only one video file
- added option to not start video playback on looper startup (boot)

#### new in v1.0.17
- GPIO pins can now be used to send "keyboard commands", i.e. to pause playback or shut down the system

Expand Down
5 changes: 5 additions & 0 deletions assets/video_looper.ini
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ resume_playlist = false
one_shot_playback = false
#one_shot_playback = true

# play videos on startup
# it is usefull to disable this if you want to trigger videos only by e.g. gpio
play_on_startup = true
#play_on_startup = false

# Set the background to a custom image
# This image is displayed between movies or images
# an image will be scaled to the display resolution and centered. Use i.e.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages

setup(name = 'Adafruit_Video_Looper',
version = '1.0.17',
version = '1.0.18',
author = 'Tony DiCola',
author_email = '[email protected]',
description = 'Application to turn your Raspberry Pi into a dedicated looping video playback device, good for art installations, information displays, or just playing cat videos all day.',
Expand Down

0 comments on commit cf0fd4d

Please sign in to comment.