Streaming live at 10am (PST)

Stop HTML5 Video Playing On Close Of Modal

I’ve seen some posts on this but nothing specific to my case that I know of…

I have an HTML5 Video player playing videos from dropbox in a modal. Just want to stop the videos playing when I close the modal…

I have close modal on an interaction…

Click on ‘Lagree Fitness’ or ‘NBCU’ thumbnails to activate ‘modal’ with videos.

Hope I can get some help and hopefully this helps others too!!

Site Preview : https://zerosix.webflow.io/#projects
Read only here : How to Pause and Stop a Video in a Modal on Close?

You can try to add below js to the Before < /body> tag field in Custom Code in your page settings.

<script>
$('.close-popup').click(function(){
  $('video').each(function(){
    $(this).get(0).pause();
  })
});
</script>
1 Like

Hiu!! You are a genius!! Thank you!!!

you are welcome. it is a simple js script, you can try to learn yourself, js is fun :handshake:

1 Like

I will try! I need to learn some languages and really learn to code! Thank you again!!

1 Like