# Pause/play functionality when displaying a video on an RGB LED Matrix

**URL:** <https://rpi-rgb-led-matrix.discourse.group/t/pause-play-functionality-when-displaying-a-video-on-an-rgb-led-matrix/603>\
**Category:** Uncategorized\
**Created:** [December 28, 2022, 2:15pm UTC](https://rpi-rgb-led-matrix.discourse.group/t/pause-play-functionality-when-displaying-a-video-on-an-rgb-led-matrix/603 "2022-12-28T14:15:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zedoispontosbarra](https://avatars.discourse-cdn.com/v4/letter/z/54ee81/32.png) [@zedoispontosbarra](https://rpi-rgb-led-matrix.discourse.group/u/zedoispontosbarra)\
**Post date:** [December 28, 2022, 2:15pm UTC](https://rpi-rgb-led-matrix.discourse.group/t/pause-play-functionality-when-displaying-a-video-on-an-rgb-led-matrix/603/1 "2022-12-28T14:15:01Z")

</div>

Hi everyone.  
I’m currently using a RPi4 and the compiled awesome video-viewer from the utils folder. It all works fine.

I’d like to be able to pause whatever is playing on the matrix, with a toggle switch. So when I toggled down the switch, it would stop the video and stay paused on that frame, until I toggled the switch back up, witch should make the video continue playing.  
The code that would handle the GPIO - toggle switch I can figure out, but I don’t know enough to add the play/pause functionality I want to video\_viewer.cc  
Can someone give me a hint?  
Or if I’m looking at it wrong, please let me know.

I also thought of using python, but there isn’t a video-viewer.py in the bindings/python/samples folder that I can adapt to my needs.

My first try to solve this was to pause/continue the unix process with 'kill -STOP but that sends it to the bg, and stops displaying the video on the matrix until I ‘kill - CONT ’, so it’s not something I can use.

Thanks!

---

<div class="post-metadata">

**Author:** ![marcmerlin](https://yyz2.discourse-cdn.com/free1/user_avatar/rpi-rgb-led-matrix.discourse.group/marcmerlin/32/40_2.png) [@marcmerlin](https://rpi-rgb-led-matrix.discourse.group/u/marcmerlin)\
**Post date:** [May 2, 2023, 3:51am UTC](https://rpi-rgb-led-matrix.discourse.group/t/pause-play-functionality-when-displaying-a-video-on-an-rgb-led-matrix/603/2 "2023-05-02T03:51:27Z")

</div>

you’ll have to modify/edit the video viewer code
