adafruit / pi_video_looper

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.
GNU General Public License v2.0
443 stars 240 forks source link

Feature request: customisable keyboard commands #199

Closed Oppfields closed 9 months ago

Oppfields commented 9 months ago

Hi,

I use a programmable number pad to control Videolooper (k to skip, s to stop). This is a convenient and compact solution but more expensive than a non-programmable num pad. To keep costs down a basic num pad could be used if the keyboard mapping could be customised. My use case: video installations, failover video for VJ work, signage

I would like to suggest the following feature requests / wish list:

  1. customisable keyboard mapping
  2. pause playhead
  3. pause on first frame
tofuSCHNITZEL commented 9 months ago

Hi, its very easy to customise the keyboard commands to the keys you need: just edit the _handle_keyboard_shortcuts function in: https://github.com/adafruit/pi_video_looper/blob/55cb6d804ff0047e448253078fd6cc8214536936/Adafruit_Video_Looper/video_looper.py#L426 and set the pygame events as needed - the key constants are referenced here: https://www.pygame.org/docs/ref/key.html it now even possible to run a specific videofile: e.g. Numberpad 5 plays "test.mp4":

if event.key == pygame.K_KP5:
    self._playlist.set_next("test.mp4")
    self._player.stop(3)
  1. is possible since v1.0.13 (mapped to space bar)
  2. unfortunately is not possible currently