Stop looping multiple background videos

I have two blocks with background video on my site. I need to make them stop at the end.

I used the following code:
<script> const heroVideo = document.getElementById('backgroundVideo').children heroVideo[0].removeAttribute("loop") </script>
but i can stop only one video


Here is my site Read-Only: LINK
(how to share your site Read-Only link)