@@ -57,6 +57,7 @@ def __init__(self, config_path):
57
57
# Load other configuration values.
58
58
self ._osd = self ._config .getboolean ('video_looper' , 'osd' )
59
59
self ._is_random = self ._config .getboolean ('video_looper' , 'is_random' )
60
+ self ._one_shot_playback = self ._config .getboolean ('video_looper' , 'one_shot_playback' )
60
61
self ._resume_playlist = self ._config .getboolean ('video_looper' , 'resume_playlist' )
61
62
self ._keyboard_control = self ._config .getboolean ('control' , 'keyboard_control' )
62
63
self ._copyloader = self ._config .getboolean ('copymode' , 'copyloader' )
@@ -435,6 +436,7 @@ def _handle_keyboard_shortcuts(self):
435
436
self ._print ("k was pressed. skipping..." )
436
437
self ._playlist .seek (1 )
437
438
self ._player .stop (3 )
439
+ self ._playbackStopped = False
438
440
if event .key == pygame .K_s :
439
441
if self ._playbackStopped :
440
442
self ._print ("s was pressed. starting..." )
@@ -454,6 +456,7 @@ def _handle_keyboard_shortcuts(self):
454
456
self ._print ("b was pressed. jumping back..." )
455
457
self ._playlist .seek (- 1 )
456
458
self ._player .stop (3 )
459
+ self ._playbackStopped = False
457
460
458
461
def _handle_gpio_control (self , pin ):
459
462
if self ._pinMap == None :
@@ -462,6 +465,7 @@ def _handle_gpio_control(self, pin):
462
465
self ._print ("pin {} triggered: {}" .format (pin , action ))
463
466
self ._playlist .set_next (action )
464
467
self ._player .stop (3 )
468
+ self ._playbackStopped = False
465
469
466
470
def _gpio_setup (self ):
467
471
if self ._pinMap == None :
@@ -511,6 +515,9 @@ def run(self):
511
515
if self ._playlist .length ()== 1 :
512
516
infotext = '(endless loop)'
513
517
518
+ if self ._one_shot_playback :
519
+ self ._playbackStopped = True
520
+
514
521
# Start playing the first available movie.
515
522
self ._print ('Playing movie: {0} {1}' .format (movie , infotext ))
516
523
# todo: maybe clear screen to black so that background (image/color) is not visible for videos with a resolution that is < screen resolution
0 commit comments