Stopping Video sound when Modal is closed

I have a modal which plays a video. When I close the modal the video still plays audio.

The video is closed by clicking “Skip Video”
Here’s the site live link: here

Here’s the read-only link: https://preview.webflow.com/preview/accela-6b408f29a6797bfc3f-ecd2f4351342a?utm_medium=preview_link&utm_source=designer&utm_content=accela-6b408f29a6797bfc3f-ecd2f4351342a&preview=d9fb0d12a50184d163a020835981dd8f&workflow=preview
I believe this will require custom code, hope someone can assist thank you!

Hello,

Put this before body page setting custom code:

<!-- stop video when user click skip -->
<script>
var vid = document.getElementById("bVideo");

$( ".landing" ).click(function() {
  console.log( "Handler for .click() called." );
  pauseVid();  
});

function pauseVid() {
    vid.pause();
}
</script>

Keep in mind if you change class -or- id names under webflow designer for:

  1. video id
  2. button class name

You should also update code selectors.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.