Custom Code: Video Modal stop playing on close

Hey there,

I was offered some custom code help for creating a video modal. The lightbox didn’t respond well across devices so I made one. How do I add this piece of code to make the video stop playing once the modal is closed?

<script> $(document).ready(function() { // config var openvideobutton = ‘.videolink’; var closevideobutton = ‘.hidevideo’; // do not touch! var vsrc = $(‘.w-video’).find(‘iframe’).attr(‘src’); //functions $(openvideobutton).click(function() { $(‘.w-video’).find(‘iframe’).attr(‘src’, vsrc); }); $(closevideobutton).click(function() { $(‘.w-video’).find(‘iframe’).attr(‘src’, ‘’); }); }); </script>

Here is my site share link and the live site:
https://preview.webflow.com/preview/dragonglass-eaa6cd?utm_source=dragonglass-eaa6cd&preview=da9fd9561c4e9e0f31db4962e90c550d

https://www.dragonglassmachines.com/

Thank you!

Zach