Pause or stop Vimeo video after closing modal custom code

Hey @swartzenmedia!

(Note: I’m @bartekkustra - I created new account a while back)
There are two ways you can approach this:

Option 1

Instead of using custom lightbox you can use Webflow Lightbox. I noticed you’re using Collection List there to display those, so feel free to check the community-made Dynamic Lightbox Code:

That way if you close the lightbox the video will just stop :slight_smile:

Option 2

The other way is - instead of using VIDEO field in Collection and VIDEO widget in Webflow - to build custom VIMEO player inside of your custom modal. There are great docs on that here:

https://developer.vimeo.com/player/sdk/basics

Having that done you can then access the Vimeo Player SDK methods (Vimeo) that will allow you to play/pause the video. You’ll be able to call those by simply attaching a custom code to the closing icon of your custom modal, eg:

$('#close-btn').click(function() {
 // https://developer.vimeo.com/player/sdk/reference#pause-a-video
  player.pause();
});

Hope this helps! :slight_smile:
Cheers,
Bart