How to stop motion detection for a while

Hi!

I have a project that would be displayed as an installation. The project needs two components such as a screen and a projection to reflect the videos which are 4 different videos. First video will be shown in the screen. If someone is recognized via motion detection first video will continue until the end then second video will be displayed and this video will appear on projection. If someone is detected when the third video is shown in the screen, the forth video will appear on projection. The code does not work how I expected. I need to stop motion detection as long as one of my target videos are playing. Is there a solution to this problem, please help!

video_son.v4p (57.6 kB)
555_1.rar (32.4 MB)
anim1_ekran.rar (2.6 MB)
anim2_ekran.rar (1.2 MB)
projektor_1.rar (7.5 MB)
projektor2.rar (3.7 MB)